[#CTxMemPool-GetTransactionAncestry]
= xref:CTxMemPool.adoc[CTxMemPool]::GetTransactionAncestry
:relfileprefix: ../
:mrdocs:

Calculate the ancestor and cluster count for the given transaction&period; The counts include the transaction itself&period; When ancestors is non&hyphen;zero (ie, the transaction itself is in the mempool), ancestorsize and ancestorfees will also be set to the appropriate values&period;

== Synopsis

Declared in `&lt;txmempool&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
GetTransactionAncestry(
    xref:Txid.adoc[Txid] const& txid,
    size&lowbar;t& ancestors,
    size&lowbar;t& cluster&lowbar;count,
    size&lowbar;t* ancestorsize = nullptr,
    xref:CAmount.adoc[CAmount]* ancestorfees = nullptr) const;
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *txid*
| The transaction to query&period;
| *ancestors*
| Set to the ancestor count (including the transaction itself)&period;
| *cluster&lowbar;count*
| Set to the size of the transaction&apos;s cluster&period;
| *ancestorsize*
| If non&hyphen;null, set to the aggregate ancestor size&period;
| *ancestorfees*
| If non&hyphen;null, set to the aggregate ancestor fees&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
