mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
Merge bitcoin/bitcoin#12677: RPC: Add ancestor{count,size,fees} to listunspent output
6cb60f3e6ddoc/release-notes: Add new listunspent fields (Luke Dashjr)0be2f17ef5QA: Add tests for listunspent ancestor{count,size,fees} to mempool_packages (Luke Dashjr)6966e80f45RPC: Add ancestor{count,size,fees} to listunspent output (Luke Dashjr)3f77dfdaf0Expose ancestorsize and ancestorfees via getTransactionAncestry (Luke Dashjr) Pull request description: Requested by a user ACKs for top commit: prayank23: reACK6cb60f3e6dfjahr: Code review re-ACK6cb60f3e6dkiminuo: ACK [6cb60f3](6cb60f3e6d) achow101: Code Review ACK6cb60f3e6dnaumenkogs: ACK6cb60f3e6ddarosior: utACK6cb60f3e6dTree-SHA512: 5d16e5799558691e5853ab7ea2cc85514cb45da3ce69134d855c71845beef32ec6af5ab28d4462683e9800c8ea126f162773a9d3d5660edac08fd8edbfeda173
This commit is contained in:
@@ -1174,12 +1174,14 @@ uint64_t CTxMemPool::CalculateDescendantMaximum(txiter entry) const {
|
||||
return maximum;
|
||||
}
|
||||
|
||||
void CTxMemPool::GetTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) const {
|
||||
void CTxMemPool::GetTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants, size_t* const ancestorsize, CAmount* const ancestorfees) const {
|
||||
LOCK(cs);
|
||||
auto it = mapTx.find(txid);
|
||||
ancestors = descendants = 0;
|
||||
if (it != mapTx.end()) {
|
||||
ancestors = it->GetCountWithAncestors();
|
||||
if (ancestorsize) *ancestorsize = it->GetSizeWithAncestors();
|
||||
if (ancestorfees) *ancestorfees = it->GetModFeesWithAncestors();
|
||||
descendants = CalculateDescendantMaximum(it);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user