got a problem when testing rpc calls on bitcoind in regtest mode: When i send one payment from node1 to node2 and then try to make 30 payments from node2 to node1, 25 transactions creates successfully, and then i'm start getting errors. This is not a problem, but problem is that:
- according to listtransactions, 26-th transaction was created successfully but rpc returned error
- if you try to get info about 26-th transaction by call "gettransaction" all is ok, but "getrawtransaction" returns error "No information available about transaction"
- starting from this point, rest of money on node2 is locked in unconfirmed state, and generating new blocks doesn't help
I tested official bitcoin core 0.12 on macbook air 13 2011 with ssd, and 0.12 bitcoind on linux with hdd (installed from ubuntu ppa)
script to reproduce:
!/bin/bash
echo "cleanup" killall bitcoind && sleep 2 && killall bitcoind rm -rf ~/bitcoind-regtest1 ~/bitcoind-regtest2 mkdir ~/bitcoind-regtest1 ~/bitcoind-regtest2
echo "start servers in regtest mode" bitcoind --server --listen --port=17591 --addnode=127.0.0.1:17592 --datadir=$HOME/bitcoind-regtest1 --regtest --rpcbind=127.0.0.1 --rpcuser=username --rpcpassword=password --rpcport=18333 --rpcthreads=2 --debug & bitcoind --server --listen --port=17592 --addnode=127.0.0.1:17591 --datadir=$HOME/bitcoind-regtest2 --regtest --rpcbind=127.0.0.1 --rpcuser=username --rpcpassword=password --rpcport=18334 --rpcthreads=2 --debug &
echo "wait wallets to start" sleep 20
export CLI1="bitcoin-cli --rpcconnect=127.0.0.1 --rpcport=18333 --rpcuser=username --rpcpassword=password --regtest" export CLI2="bitcoin-cli --rpcconnect=127.0.0.1 --rpcport=18334 --rpcuser=username --rpcpassword=password --regtest"
echo "generate 50 mature coins on node 2" $CLI2 generate 101
echo "send 1btc to address on node 1"
$CLI2 sendtoaddress $CLI1 getnewaddress testaccount 1
echo "confirm transactions" $CLI2 generate 6
echo "wait wallets to syncronize" sleep 5
echo "make 30 transactions from node 1 to node 2"
for i in {1..30};do $CLI1 sendfrom testaccount $CLI2 getnewaddress 0.00$i;done
If you now try listtransactions, you will see, that transaction with sum 0.0026btc exists, and gettransaction retuns successfully, but getrawtransaction returns error.
moreover, rest of funds are stuck in unconfirmed state, please look:
export CLI1="bitcoin-cli --rpcconnect=127.0.0.1 --rpcport=18333 --rpcuser=username --rpcpassword=password --regtest" $CLI1 getwalletinfo $CLI generate 20 $CLI1 getwalletinfo