Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
When creating a large number of unconfirmed transactions (e.g. 500+) with bitcoin-cli
by spending/sending from a wallet, sending/spending the 502nd time results in a nondescript error message. It may be the case that this is expected behavior (e.g. reaching a limit), and the error message could be made more descriptive/informative.
0error code: -1
1error message:
2map::at
This was encountered when creating a test to populate the mempool with a high number of transactions for the v27.0 RC Testing Guide. This behavior was observed both on v26.0 and v27.0 rc1.
Confirming the transactions in a block allows the user to perform additional spending.
Expected behaviour
A more descriptive error message would be provided to the user. In this case, if a limit is being reached, the user could be informed and take appropriate action (e.g. wait until a block confirms transactions, etc.).
Steps to reproduce
Start a node on regtest with its own datadir/bitcoin.conf:
0export DATA_DIR=/tmp/tmpdatadir
1mkdir $DATA_DIR
2export BINARY_PATH=/path/to/dir/containing/bitcoind
3alias bitcoind-test="$BINARY_PATH/bitcoind -datadir=$DATA_DIR"
4alias bcli="$BINARY_PATH/bitcoin-cli -datadir=$DATA_DIR"
5echo "regtest=1" > $DATA_DIR/bitcoin.conf
6bitcoind-test -daemon
Create a wallet, fund it with coinbase outputs, and send 501 times:
0bcli createwallet test
1export ADDRESS=$(bcli -rpcwallet=test getnewaddress)
2bcli -rpcwallet=test -generate 701
3for i in $(seq 1 499); do bcli -rpcwallet=test -named send outputs="{\"$ADDRESS\": 1}" fee_rate=10; done
4bcli -rpcwallet=test getmempoolinfo
5bcli -rpcwallet=test -named send outputs="{\"$ADDRESS\": 1}" fee_rate=10
6bcli -rpcwallet=test getmempoolinfo
7bcli -rpcwallet=test -named send outputs="{\"$ADDRESS\": 1}" fee_rate=10
8bcli -rpcwallet=test getmempoolinfo
Induce the error on the 502nd send:
0bcli -rpcwallet=test -named send outputs="{\"$ADDRESS\": 1}" fee_rate=10
1error code: -1
2error message:
3map::at
Confirm transactions, then add a new transaction:
0bcli -rpcwallet=test -generate 1
1bcli -rpcwallet=test -named send outputs="{\"$ADDRESS\": 1}" fee_rate=10
2bcli -rpcwallet=test getmempoolinfo
Relevant log output
Nothing relevant observed in debug.log at the time of the error received.
How did you obtain Bitcoin Core
Pre-built binaries
What version of Bitcoin Core are you using?
v26.0.0
Operating system and version
Ubuntu 22.04 LTS
Machine specifications
amd64