diff options
| author | Sjors Provoost <[email protected]> | 2020-08-07 13:53:51 +0200 |
|---|---|---|
| committer | Sjors Provoost <[email protected]> | 2020-08-07 14:13:15 +0200 |
| commit | 6d1f51343cf11b07cd401fbd0c5bc3603e185a0e (patch) | |
| tree | 4c7b2379cffe5e1617f298fc9ea8e0d9adc1c6f4 /src | |
| parent | Merge #19098: test: Remove duplicate NodeContext hacks (diff) | |
| download | discoin-6d1f51343cf11b07cd401fbd0c5bc3603e185a0e.tar.xz discoin-6d1f51343cf11b07cd401fbd0c5bc3603e185a0e.zip | |
[rpc] fundrawtransaction, walletcreatefundedpsbt lock manually selected coins
Previously only automatically selected coins were locked when lockUnspents is set.
It now also locks selected coins.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet/rpcwallet.cpp | 1 | ||||
| -rw-r--r-- | src/wallet/wallet.cpp | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 39d1f49e9..cc7d6cbaf 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2047,6 +2047,7 @@ static UniValue lockunspent(const JSONRPCRequest& request) "Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.\n" "If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked.\n" "A locked transaction output will not be chosen by automatic coin selection, when spending bitcoins.\n" + "Manually selected coins are automatically unlocked.\n" "Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list\n" "is always cleared (by virtue of process exit) when a node stops or fails.\n" "Also see the listunspent call\n", diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index cee2f2214..2166373a7 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2609,10 +2609,11 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nC if (!coinControl.IsSelected(txin.prevout)) { tx.vin.push_back(txin); - if (lockUnspents) { - LockCoin(txin.prevout); - } } + if (lockUnspents) { + LockCoin(txin.prevout); + } + } return true; |