25+ transactions and one UTXO #7750

issue pavimus opened this issue on March 27, 2016
  1. pavimus commented at 7:18 AM on March 27, 2016: none

    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:

    1. according to listtransactions, 26-th transaction was created successfully but rpc returned error
    2. 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"
    3. 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

  2. sipa commented at 10:18 AM on March 27, 2016: member

    gettransaction is a wallet RPC, it only works for transactions in the wallet.

    getrawtransaction is a node RPC, and will only work for transactions in the mempool or (when running with -txindex) in the blockchain.

  3. pavimus commented at 10:27 AM on March 27, 2016: none

    thanks for comment, Sipa!

    This explains why getrawtransaction doesn't return any data: transaction was created and saved in wallet, but rejected by mempool. May be after 25 transactions will be confirmed i can do some rpc call which will try to put existing 26-th transaction in mempool again?

  4. sipa commented at 10:31 AM on March 27, 2016: member

    Why do you need getrawtransaction? Gettransaction gives you all you need, for wallet transactions.

  5. pavimus commented at 10:41 AM on March 27, 2016: none

    In gettransaction output i can't find change address. want to backup it with private key in encrypted form in my database immediately after creating transaction. Getrawtransaction returns all vouts (payment destination address and change address)

  6. sipa commented at 10:46 AM on March 27, 2016: member

    Take the "hex" field from gettransaction, and pass it into decoderawtransaction.

  7. pavimus commented at 10:52 AM on March 27, 2016: none

    Thank you! this definitely will solve problem with getting transaction changeAddress

    But main problem why i created issue, was another: after creating 26-th transaction rest of money was locked in unconfirmed_balance. And i can't use them anymore, because even generating new blocks doesn't help.

  8. MarcoFalke commented at 11:14 AM on March 27, 2016: member

    transaction was created and saved in wallet, but rejected by mempool.

    This is a known issue and you'd have to increase the -limit*count: #6771 (comment)

    even generating new blocks doesn't help.

    You'd need to get the wallet transactions back into the mempool first.

  9. pavimus commented at 11:34 AM on March 27, 2016: none

    Yes, after confirming 25 mempool transactions i was able to put 26-th transaction to mempool again by getting hex representation with gettransaction and then calling sendrawtransaction. May be there is one rpc call that will detect unsent transactions and put it to mempool?

    Thank you all for help! Should i close this issue, or this behavior is unexpected and

    1. 26-th transaction must be not created at all
    2. or 26-th transaction must be automatically pickuped by mempool after previous transactions confirmation ?
  10. MarcoFalke commented at 11:40 AM on March 27, 2016: member

    May be there is one rpc call that will detect unsent transactions and put it to mempool?

    Iirc, the wallet will do this automatically from time to time or the node, after every restart.

  11. sipa commented at 11:57 AM on March 27, 2016: member

    The wallet will try to rebroadcast every 20-30 minutes.

  12. pavimus commented at 12:03 PM on March 27, 2016: none

    Thank you for help!

  13. pavimus closed this on Mar 27, 2016

  14. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC