You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Long unconfirmed transaction chain doesn't get mined in regtest #1088
elementsd -chain=elementsregtest -initialfreecoins=2100000000000000 -anyonecanspendaremine=1 -validatepegin=0 -datadir=/tmp/elements-test
alias cli='elements-cli -chain=elementsregtest -datadir=/tmp/elements-test'
cli createwallet default
cli rescanblockchain # pick up anyonecanspend
addr=$(cli getnewaddress)foriin {1..26};do cli sendtoaddress $addr 1;done# the 26th transaction results in the following log message:# [default] CommitTransaction(): Transaction cannot be broadcast immediately, too-long-mempool-chain, too many unconfirmed ancestors [limit: 25]# (but `sendtoaddress` still replies successfully with its txid)
cli getmempoolinfo | jq .size
# prints 25 (the 26th transaction was ignored)
cli generatetoaddress 1 $addr
cli getmempoolinfo | jq .size
# still prints 25 -- all the transactions seem to be stuck in the mempool and don't get selected into mined blocks
#206 reported a similar issue (but possibly due to a different cause?).
Note that you need to reset the regtest chain between the tests. Initially there's only one coin (the initialfreecoin) which ensures that every transaction chains off the previous one, but after some transactions are sent successfully there will be more coins that can interfere with the test.
Activity
shesek commentedon Jan 23, 2022
I ran some more testing and it appears that a chain of 7 transactions is sufficient to trigger this behavior:
Note that you need to reset the regtest chain between the tests. Initially there's only one coin (the
initialfreecoin) which ensures that every transaction chains off the previous one, but after some transactions are sent successfully there will be more coins that can interfere with the test.