Merge #11864: Make CWallet::FundTransaction atomic
commit2ae58d5bfb76ba01ceb52518281f0eeaaf2882f7
authorWladimir J. van der Laan <laanwj@gmail.com>
Thu, 14 Dec 2017 09:35:58 +0000 (14 10:35 +0100)
committerWladimir J. van der Laan <laanwj@gmail.com>
Thu, 14 Dec 2017 09:38:20 +0000 (14 10:38 +0100)
tree1b88942a92de43c2bc5dadbd234841f82183683a
parentd4991c0cbb8a5464add1b64268eccdbfd3026d6e
parent03a5dc9c3c522c500c77fdecd52d091db048d1b0
Merge #11864: Make CWallet::FundTransaction atomic

03a5dc9 [wallet] Make CWallet::FundTransaction atomic (João Barbosa)
95d4450 [wallet] Tidy up CWallet::FundTransaction (João Barbosa)

Pull request description:

  This PR fixes a race for `setLockedCoins` when `lockUnspents` is true. For instance, it should not be possible to use the same unspent in concurrent `fundrawtransaction` calls.

  Now the `cs_main` and `cs_wallet` locks are held during `CreateTransaction` and `LockCoin`(s). Also added some style nits around the change.

Tree-SHA512: ccf383c0c5f6db775655a3e9ccd200c3bd831a83afae2b7c389564c74f7227f5bea86a4775727de2c3603b188f383f8a12d3f9d6d94f7887865c31c94ce95ef6
src/wallet/wallet.cpp