diff --git a/src/spark/sparkwallet.cpp b/src/spark/sparkwallet.cpp index 5b9372308e..fea70579be 100644 --- a/src/spark/sparkwallet.cpp +++ b/src/spark/sparkwallet.cpp @@ -1199,6 +1199,10 @@ CWalletTx CSparkWallet::CreateSparkSpendTransaction( for (size_t i = 0; i < recipients.size(); i++) { auto& recipient = recipients[i]; + if (recipient.scriptPubKey.IsPayToExchangeAddress()) { + throw std::runtime_error("Cannot create private transaction with exchange address as a destination"); + } + if (!MoneyRange(recipient.nAmount)) { throw std::runtime_error(boost::str(boost::format(_("Recipient has invalid amount")) % i)); } diff --git a/src/wallet/lelantusjoinsplitbuilder.cpp b/src/wallet/lelantusjoinsplitbuilder.cpp index ebb0666ec5..b294bd3900 100644 --- a/src/wallet/lelantusjoinsplitbuilder.cpp +++ b/src/wallet/lelantusjoinsplitbuilder.cpp @@ -59,6 +59,10 @@ CWalletTx LelantusJoinSplitBuilder::Build( for (size_t i = 0; i < recipients.size(); i++) { auto& recipient = recipients[i]; + if (recipient.scriptPubKey.IsPayToExchangeAddress()) { + throw std::runtime_error("Cannot create private transaction with exchange address as a destination"); + } + if (!MoneyRange(recipient.nAmount)) { throw std::runtime_error(boost::str(boost::format(_("Recipient has invalid amount")) % i)); }