1

I don't seem to be able to ask the right question in the title, the way I asked the question is not correct.
What I really want to know is this:

I can spend an unconfirmed output, then I can spend the output that spends that unconfirmed output, and I can spend that output, too, and so on...

My question is: how many times can I do it?

Edit: I just tried it in the testnet, I got this message: 64: too-long-mempool-chain. Is this 64 an universal number?
Edit 2: It turns out 64 is the error code. The actual number is 25.

3

There is no limit in the consensus rules about that. However nodes have a local policy rule about this. In Bitcoin Core, the limit is 25 unconfirmed transactions. This limit is user configurable.

  • How does one increase the limit? What is the bitcoin.conf setting? – qmux Jan 12 at 11:42
  • 1
    @qmux You will need to increase the -limitacnestorcount, -limitancestorsize, -limitdescendantcount, and -limitdescendantsize settings to increase the limit. The Bitcoin Core wallet may be unable to reach the limit because the wallet operates with different, stricter limits. – Andrew Chow Jan 12 at 16:22
  • 1
    These are options to bitcoind. You either add them to the bitcoin.conf as, e.g. limitancestorcount=30, or to the command to start, e.g. bitcoind -limitancestorcount=30. – Andrew Chow Jan 12 at 21:27
  • 1
    Insufficient funds is unrelated to the unconfirmed children limit. Increasing it won't have any effect on that. Even if the wallet knows about a transaction, it may not choose to use it for creating new transactions. The wallet has additional rules on what inputs may be selected. It doesn't just choose things if it knows about them because that may not be safe. – Andrew Chow Jan 12 at 23:05
  • 1
    There are no such resources as there is no way to configure the coin selection algorithm like that. At best, you will only be able to spend unconfirmed change. Bitcoin Core does not spend from incoming unconfirmed transactions because it is unsafe to do so. The node and wallet operate fairly independently - something that is accepted by the node may not be able to be created by the wallet. The wallet isn't refusing to broadcast anything, it is refusing to create it in the first place. – Andrew Chow Jan 12 at 23:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.