Page MenuHomePhabricator

Merge #11864: Make CWallet::FundTransaction atomic
ClosedPublic

Authored by nakihito on Jun 4 2019, 17:14.

Details

Summary

03a5dc9 [wallet] Make CWallet::FundTransaction atomic (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

Part 2 of 2 of Core PR11864
https://github.com/bitcoin/bitcoin/pull/11864/commits/03a5dc9c3c522c500c77fdecd52d091db048d1b0

Commit:

Make CWallet::FundTransaction atomic
03a5dc9c3c522c500c77fdecd52d091db048d1b0

Depends on D3192

Test Plan
make check
test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR11864-2
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6138
Build 10324: Bitcoin ABC Buildbot (legacy)
Build 10323: arc lint + arc unit