0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

Switch to GetTransactionAncestry() in OutputEligibleForSpending

This commit is contained in:
Karl-Johan Alm 2018-03-08 12:16:16 -05:00
parent 475a385a80
commit 4784751547
No known key found for this signature in database
GPG key ID: 57AF762DB3353322

View file

@ -2469,8 +2469,11 @@ bool CWallet::OutputEligibleForSpending(const COutput& output, const CoinEligibi
if (output.nDepth < (output.tx->IsFromMe(ISMINE_ALL) ? eligibility_filter.conf_mine : eligibility_filter.conf_theirs))
return false;
if (!mempool.TransactionWithinChainLimit(output.tx->GetHash(), eligibility_filter.max_ancestors, eligibility_filter.max_descendants))
int64_t ancestors, descendants;
mempool.GetTransactionAncestry(output.tx->GetHash(), ancestors, descendants);
if (ancestors >= eligibility_filter.max_ancestors || descendants >= eligibility_filter.max_descendants) {
return false;
}
return true;
}