Bitcoin
Pronto para usar isso em produção?
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
Bitcoin
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
getmempoolancestors is a Bitcoin Core JSON-RPC method that walks the dependency graph of a pending BTC transaction backwards: given a txid that is still sitting in the node's mempool, it returns every other unconfirmed transaction that must be mined before it — its ancestors. Because Bitcoin uses an unspent-output (UTXO) model rather than accounts, a transaction can only be valid once the outputs it spends exist on-chain, so an unconfirmed transaction that spends an unconfirmed output forms an ancestor chain. Send the request to https://bitcoin.therpc.io/YOUR_API_KEY using positional params. By default the method returns a flat array of ancestor txids; pass verbose = true to get an object keyed by txid carrying the same per-transaction fields as getmempoolentry (vsize, weight, fees in BTC, ancestor/descendant counts, and more).
verbose = true) to compute an effective package fee rate in sat/vB and decide whether a child-pays-for-parent (CPFP) bump is worthwhile.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | txid | string | Sim | Transaction id, which must be in the mempool. |
| 2 | verbose | boolean | Não | false = array of txids; true = object keyed by txid with per-tx data.Padrão: false |
| Tipo | Descrição |
|---|---|
| array | Array of ancestor txids, or (verbose) object keyed by txid with the same per-tx fields as getmempoolentry. |
| Código | Mensagem | Causa |
|---|---|---|
-5 | Transaction not in mempool | The txid is not currently in this node's mempool — it may be confirmed, evicted, or never seen. |
-5 if the txid you pass is not currently in this node's mempool — for example because it has already confirmed, was evicted under fee pressure, or was never relayed to the node.