A Bitcoin unconfirmed transaction has an ancestorcount of one. Why does it have no unconfirmed parent?
Bitcoin Core’s getmempoolentry returns ancestorcount, the ancestor count in the current node’s mempool. This field includes the transaction being queried. As long as the transaction is in the mempool, this count can be one, even if all the inputs it spends come from confirmed transactions.
Suppose a payment spends an output from another transaction that is still in the mempool, and there are no earlier unconfirmed dependencies. From this node’s perspective, the payment transaction and its parent are both included in the ancestor count. If the parent transaction is confirmed first, the payment transaction remains in the mempool, and its ancestor count can drop back to one. The payment amount and transaction hash can stay the same, because what changes is the dependency in the node’s mempool.
When investigating a $BTC payment that is pending confirmation, you can look at the ancestor count alongside the list of dependent transactions. The former includes the transaction itself, while the latter can help identify its direct dependencies. When recording this information, note which node it came from and when it was queried. This count describes the current scope of unconfirmed dependencies; by itself, it cannot predict when the transaction will be included.
This article explains Bitcoin Core query fields. For technical discussion only.
#BTC #Bitcoin
Original source: https://bitcoincore.org/en/doc/30.0.0/rpc/blockchain/getmempoolentry/