Coin selection choosing prevouts spent in just-mined block #6045
Labels
A-wallet
Area: Wallet
C-bug
Category: This is a bug
D-bitcoin-divergence
Design issue: Divergence from Bitcoin (upstream code and/or architecture).
I-race
Problems and improvements related to race conditions.
There appears to be a race somewhere when it comes to coin locking and coin selection (
CWallet::SelectCoins
, I think).Steps to reproduce
zcashd -regtest
zcash-cli -regtest generate 150
ADDR=`zcash-cli -regtest getnewaddress`; zcash-cli -regtest sendtoaddress $ADDR 1; zcash-cli -regtest generate 1; zcash-cli -regtest sendtoaddress $ADDR 1;
You may need to run step 3 a couple of times.
The error message is
And I've managed to further identify the error as originating from
and have additionally verified that the same outputs are being selected for the second tx as for the just-mined first tx.
On the other hand, if you put in a delay.
ADDR=`zcash-cli -regtest getnewaddress`; zcash-cli -regtest sendtoaddress $ADDR 1; zcash-cli -regtest generate 1; sleep 1s; zcash-cli -regtest sendtoaddress $ADDR 1;
it sends without error every time.
The text was updated successfully, but these errors were encountered: