From 5f4362cb825237f5bde9d47c1c3a028c113e7f6e Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Thu, 14 Sep 2017 14:41:58 +0300 Subject: [PATCH] fix SPORK_5_INSTANTSEND_MAX_VALUE validation in CWallet::CreateTransaction (#1619) --- src/wallet/wallet.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 7c5c3ed76..205524b16 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3294,11 +3294,7 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt strFailReason += " " + _("PrivateSend uses exact denominated amounts to send funds, you might simply need to anonymize some more coins."); } else if (nValueIn < nValueToSelect) { strFailReason = _("Insufficient funds."); - } - if (fUseInstantSend) { - if (nValueIn > sporkManager.GetSporkValue(SPORK_5_INSTANTSEND_MAX_VALUE)*COIN) { - strFailReason += " " + strprintf(_("InstantSend doesn't support sending values that high yet. Transactions are currently limited to %1 DASH."), sporkManager.GetSporkValue(SPORK_5_INSTANTSEND_MAX_VALUE)); - } else { + if (fUseInstantSend) { // could be not true but most likely that's the reason strFailReason += " " + strprintf(_("InstantSend requires inputs with at least %d confirmations, you might need to wait a few minutes and try again."), INSTANTSEND_CONFIRMATIONS_REQUIRED); } @@ -3306,7 +3302,10 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt return false; } - + if (fUseInstantSend && nValueIn > sporkManager.GetSporkValue(SPORK_5_INSTANTSEND_MAX_VALUE)*COIN) { + strFailReason += " " + strprintf(_("InstantSend doesn't support sending values that high yet. Transactions are currently limited to %1 DASH."), sporkManager.GetSporkValue(SPORK_5_INSTANTSEND_MAX_VALUE)); + return false; + } BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins) {