bitcoind
and bitcoin-qt
crashes when creating a PSBT with walletcreatefundedpsbt
Expected behavior
bitcoind
and bitcoin-qt
should not crash and users should not see assertion errors on mainnet. Failing gracefully with some error message would be better. Although I was not able to reproduce this issue on Fedora so ideally this should be fixed.
Actual behavior
Error in bitcoind:
0Assertion failed: selected_effective_value >= target, file wallet/coinselection.cpp, line 391
Error in bitcoin-qt:
To reproduce
- Create bitcoin.conf
0signet=1
1txindex=1
2
3signet.rpcport=38332
4rpcuser=user
5rpcpassword=pass
6
7fallbackfee=0.0004
- Add descriptor in a wallet using bitcoin-qt console:
0importmulti '[{ "desc": "sh(multi(2,[aa130fed]02de62833c851509cf13c0c63e0dc3ef7b74f7d86b17e9090fab68c09830cb2f2e,[00890d8d]03cf11a2bc1371dad3691bce59e37d85b12aae6b030b533d4e7c5aedeb47a5ec0e))#j8w6g6zg", "timestamp":"now"}]'
- Create PSBT using bitcoin-qt, click on different options in the error message and you will notice it creates PSBT with no change by clicking ‘ignore’ 3 times else crashes with others:
0walletcreatefundedpsbt "[{\"txid\":\"e911734bf711009dd6057c88bc598df2d31c18d1cc6bd6c790a704b519d77e68\",\"vout\":0}]" "[{\"tb1q9fxp2p0sm93jdlul8v3svzn7x69zcd9ljsgans\":\"0.0009\"}]"
- Close bitcoin-qt and open powershell or command prompt to create PSBT:
0bitcoind.exe
0bitcoin-cli.exe -rpcwallet=M1 walletcreatefundedpsbt "[{\"txid\":\"e911734bf711009dd6057c88bc598df2d31c18d1cc6bd6c790a704b519d77e68\",\"vout\":0}]" "[{\"tb1q9fxp2p0sm93jdlul8v3svzn7x69zcd9ljsgans\":\"0.0009\"}]"
System information
Windows 10
Bitcoin Core Master Branch