GetMemPoolAncestors

The getmempoolancestors RPC returns all in-mempool ancestors for a transaction in the mempool.

Parameter #1—a transaction identifier (TXID)

Name Type Presence Description
TXID string (hex) Required
(exactly 1)
The TXID of the transaction. The TXID must be encoded as hex in RPC byte order

Parameter #2—desired output format

Name Type Presence Description
Format bool Optional
(0 or 1)
Set to true to get json objects describing each transaction in the memory pool; set to false (the default) to only get an array of TXIDs

Result—list of ancestor transactions

Name Type Presence Description
result array Required
(exactly 1)
An array of TXIDs belonging to transactions in the memory pool. The array may be empty if there are no transactions in the memory pool

TXID
string Optional
(0 or more)
The TXID of a transaction in the memory pool, encoded as hex in RPC byte order
result object Required
(exactly 1)
A object containing transactions currently in the memory pool. May be empty

TXID
string : object Optional
(0 or more)
The TXID of a transaction in the memory pool, encoded as hex in RPC byte order
→ →
size
number (int) Required
(exactly 1)
The size of the serialized transaction in bytes
→ →
fee
number (pai) Required
(exactly 1)
The transaction fee paid by the transaction in decimal pai’s
→ →
modifiedfee
number (pai’s) Required
(exactly 1)
The transaction fee with fee deltas used for mining priority in decimal pai’s
→ →
time
number (int) Required
(exactly 1)
The time the transaction entered the memory pool, Unix epoch time format
→ →
height
number(int) Required
(exactly 1)
The block height when the transaction entered the memory pool
→ →
startingpriority
number(int) Required
(exactly 1)
The priority of the transaction when it first entered the memory pool
→ →
currentpriority
number(int) Required
(exactly 1)
The current priority of the transaction
→ →
descendantcount
number(int) Required
(exactly 1)
The number of in-mempool descendant transactions (including this one)
→ →
descendantsize
number(int) Required
(exactly 1)
The size of in-mempool descendants (including this one)

descendantfees
number(int) Required
(exactly 1)
The modified fees (see modifiedfee above) of in-mempool descendants (including this one)
→ →
ancestorcount
number(int) Required
(exactly 1)
The number of in-mempool ancestor transactions (including this one)
→ →
ancestorsize
number(int) Required
(exactly 1)
The size of in-mempool ancestors (including this one)
→ →
ancestorfees
number(int) Required
(exactly 1)
The modified fees (see modifiedfee above) of in-mempool ancestors (including this one)
→ →
depends
number(int) Required
(exactly 1)
An array holding TXIDs of unconfirmed transactions this transaction depends upon (parent transactions). Those transactions must be part of a block before this transaction can be added to a block, although all transactions may be included in the same block. The array may be empty
→ → →
Depends TXID
string Optional (0 or more) The TXIDs of any unconfirmed transactions this transaction depends upon, encoded as hex in RPC byte order

Example

The default (false):

pai-cli getmempoolancestors 52273e0ce6cf3452932cfbc1c517c0ce\
1af1d255fda67a6e3bd63ba1d908c8c2

Result:

[
    "b104586f229e330caf42c475fd52684e9eb5e2d02f0fcd216d9554c5347b0873",
    "094f7dcbc7494510d4daeceb2941ed73b1bd011bf527f6c3b7c897fee85c11d4"
]

Verbose output (true):

pai-cli getmempoolancestors 52273e0ce6cf3452932cfbc1c517c0ce\
1af1d255fda67a6e3bd63ba1d908c8c2 true

Result:

{
  "b104586f229e330caf42c475fd52684e9eb5e2d02f0fcd216d9554c5347b0873": {
    "size": 485,
    "fee": 0.00009700,
    "modifiedfee": 0.00009700,
    "time": 1479423635,
    "height": 439431,
    "startingpriority": 15327081.81818182,
    "currentpriority": 21536936.36363636,
    "descendantcount": 1,
    "descendantsize": 485,
    "descendantfees": 9700,
    "ancestorcount": 1,
    "ancestorsize": 485,
    "ancestorfees": 9700,
    "depends": [
    ]
  },
  "094f7dcbc7494510d4daeceb2941ed73b1bd011bf527f6c3b7c897fee85c11d4": {
    "size": 554,
    "fee": 0.00005540,
    "modifiedfee": 0.00005540,
    "time": 1479423327,
    "height": 439430,
    "startingpriority": 85074.91071428571,
    "currentpriority": 3497174.4375,
    "descendantcount": 1,
    "descendantsize": 554,
    "descendantfees": 5540,
    "ancestorcount": 1,
    "ancestorsize": 554,
    "ancestorfees": 5540,
    "depends": [
    ]
  }
}

See also

  • GetMemPoolDescendants: returns all in-mempool descendants for a transaction in the mempool.
  • GetRawMemPool: returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object.