Bitcoin
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Bitcoin
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
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.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | txid | string | 是 | Transaction id, which must be in the mempool. |
| 2 | verbose | boolean | 否 | false = array of txids; true = object keyed by txid with per-tx data.默认值: false |
| 类型 | 描述 |
|---|---|
| array | Array of ancestor txids, or (verbose) object keyed by txid with the same per-tx fields as getmempoolentry. |
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-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.