diff --git a/src/instantx.cpp b/src/instantx.cpp index 4f799293e..702c97f9e 100644 --- a/src/instantx.cpp +++ b/src/instantx.cpp @@ -815,9 +815,8 @@ bool CTxLockRequest::IsValid(bool fRequireUnspent) const { if(vout.size() < 1) return false; - if(vin.size() > MAX_INPUTS) { - LogPrint("instantsend", "CTxLockRequest::IsValid -- Too many inputs: tx=%s", ToString()); - return false; + if(vin.size() > WARN_MANY_INPUTS) { + LogPrint("instantsend", "CTxLockRequest::IsValid -- WARNING: Too many inputs: tx=%s", ToString()); } LOCK(cs_main); diff --git a/src/instantx.h b/src/instantx.h index 306b4a50a..c65e7eadc 100644 --- a/src/instantx.h +++ b/src/instantx.h @@ -116,7 +116,7 @@ private: int64_t nTimeCreated; public: - static const int MAX_INPUTS = 10; + static const int WARN_MANY_INPUTS = 100; CTxLockRequest() : CTransaction(), diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 33ccca12a..23105963c 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -313,10 +313,9 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact CClientUIInterface::MSG_ERROR); return TransactionCreationFailed; } - if(newTx->vin.size() > CTxLockRequest::MAX_INPUTS) { - Q_EMIT message(tr("Send Coins"), tr("InstantSend doesn't support transactions with more than %1 inputs.").arg(CTxLockRequest::MAX_INPUTS), - CClientUIInterface::MSG_ERROR); - return TransactionCreationFailed; + if(newTx->vin.size() > CTxLockRequest::WARN_MANY_INPUTS) { + Q_EMIT message(tr("Send Coins"), tr("Used way too many inputs (>%1) for this InstantSend transaction, fees could be huge.").arg(CTxLockRequest::WARN_MANY_INPUTS), + CClientUIInterface::MSG_WARNING); } } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index e0e2fd772..57bfc0d31 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2358,9 +2358,6 @@ bool CWallet::SelectCoins(const CAmount& nTargetValue, set CTxLockRequest::MAX_INPUTS) - return false; - return (nValueRet >= nTargetValue); } @@ -3014,10 +3011,7 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt strFailReason = _("Insufficient funds."); } if (fUseInstantSend) { - size_t nMaxInputs = CTxLockRequest::MAX_INPUTS; - if(setCoins.size() > nMaxInputs) { - strFailReason += " " + strprintf(_("InstantSend doesn't support transactions with more than %d inputs."), nMaxInputs); - } else if (nValueIn > sporkManager.GetSporkValue(SPORK_5_INSTANTSEND_MAX_VALUE)*COIN) { + 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 { // could be not true but most likely that's the reason