From 049a7b2a80179826add17803166a5f291af6429f Mon Sep 17 00:00:00 2001 From: Jianping Wu Date: Fri, 16 Nov 2018 12:29:16 -0800 Subject: [PATCH] Bug: remove keva input value from the value to select. --- src/wallet/wallet.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4676d006f..d0a5dd0d8 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2810,7 +2810,7 @@ bool CWallet::CreateTransaction(const std::vector& vecSend, wtxNew.fFromMe = true; bool fFirst = true; - CAmount nValueToSelect = nValue; + CAmount nValueToSelect = nValue - nInputValue; if (nSubtractFeeFromAmount == 0) nValueToSelect += nFeeRet; // vouts to the payees @@ -3118,9 +3118,11 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CCon { // Broadcast if (!wtx.AcceptToMemoryPool(maxTxFee, state)) { + printf("JWU Transaction cannot be broadcast immediately! \n"); LogPrintf("CommitTransaction(): Transaction cannot be broadcast immediately, %s\n", state.GetRejectReason()); // TODO: if we expect the failure to be long term or permanent, instead delete wtx from the wallet and return failure. } else { + printf("JWU Transaction CAN OK be broadcast immediately! \n"); wtx.RelayWalletTransaction(connman); } }