Skip to content

Commit 29e568c

Browse files
committed
qml: Provide information if the supplied addres is valid for another network
1 parent cc15afd commit 29e568c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/qml/models/sendrecipient.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,13 @@ void SendRecipient::clear()
112112
void SendRecipient::validateAddress()
113113
{
114114
if (!m_address.isEmpty() && !IsValidDestinationString(m_address.toStdString())) {
115-
setAddressError(tr("Invalid address"));
115+
if (IsValidDestinationString(m_address.toStdString(), *CChainParams::Main())) {
116+
setAddressError(tr("Address is valid for mainnet, not the current network"));
117+
} else if (IsValidDestinationString(m_address.toStdString(), *CChainParams::TestNet())) {
118+
setAddressError(tr("Address is valid for testnet, not the current network"));
119+
} else {
120+
setAddressError(tr("Invalid address format"));
121+
}
116122
} else {
117123
setAddressError("");
118124
}

0 commit comments

Comments
 (0)