Skip to content

Commit 6ddf435

Browse files
committed
Merge #18274: rpc/wallet: initialize nFeeRequired to avoid using garbage value on failure
a652ba6 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 a652ba6. Sjors: utACK a652ba6 practicalswift: ACK a652ba6 -- patch looks correct meshcollider: utACK a652ba6 Tree-SHA512: 0d12f1ffd0851ed5ce6d109d2c87f55e8b1d57da297e684feeabb57229200c4078f029c55ca5aa5712bd18e26dda3ce538443dfe68a7a6d504428068f81fded0
2 parents 5e12a61 + a652ba6 commit 6ddf435

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static CTransactionRef SendMoney(interfaces::Chain::Lock& locked_chain, CWallet
343343
CScript scriptPubKey = GetScriptForDestination(address);
344344

345345
// Create and send the transaction
346-
CAmount nFeeRequired;
346+
CAmount nFeeRequired = 0;
347347
std::string strError;
348348
std::vector<CRecipient> vecSend;
349349
int nChangePosRet = -1;

0 commit comments

Comments
 (0)