aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2020-03-09 18:56:07 +0800
committerfanquake <fanquake@gmail.com>2020-03-09 19:17:51 +0800
commit6ddf435493cb428b10001638a726fad1ab6e55b8 (patch)
tree71ac198a32fa113e7f78d8c52a75b99441139a07 /src/wallet
parent5e12a61044b15e4e29ac786135a9ebb72d1bfc61 (diff)
parenta652ba6293ef8d144935dc882b5f0003c987fa22 (diff)
downloadbitcoin-6ddf435493cb428b10001638a726fad1ab6e55b8.tar.xz
Merge #18274: rpc/wallet: initialize nFeeRequired to avoid using garbage value on failure
a652ba6293ef8d144935dc882b5f0003c987fa22 rpc/wallet: initialize nFeeRequired to avoid using garbage value on failure (Karl-Johan Alm) Pull request description: Initialize the `nFeeRequired` variable to avoid using an uninitialized value for errors happening before it is set to 0. Note: this originally fixed `nFeeRet` in `wallet.cpp`. ACKs for top commit: promag: ACK a652ba6293ef8d144935dc882b5f0003c987fa22. Sjors: utACK a652ba6293ef8d144935dc882b5f0003c987fa22 practicalswift: ACK a652ba6293ef8d144935dc882b5f0003c987fa22 -- patch looks correct meshcollider: utACK a652ba6293ef8d144935dc882b5f0003c987fa22 Tree-SHA512: 0d12f1ffd0851ed5ce6d109d2c87f55e8b1d57da297e684feeabb57229200c4078f029c55ca5aa5712bd18e26dda3ce538443dfe68a7a6d504428068f81fded0
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/rpcwallet.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index a390050f9a..bbbaea88d1 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -343,7 +343,7 @@ static CTransactionRef SendMoney(interfaces::Chain::Lock& locked_chain, CWallet
CScript scriptPubKey = GetScriptForDestination(address);
// Create and send the transaction
- CAmount nFeeRequired;
+ CAmount nFeeRequired = 0;
std::string strError;
std::vector<CRecipient> vecSend;
int nChangePosRet = -1;