Skip to content

Commit 4784751

Browse files
committed
Switch to GetTransactionAncestry() in OutputEligibleForSpending
1 parent 475a385 commit 4784751

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/wallet/wallet.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2469,8 +2469,11 @@ bool CWallet::OutputEligibleForSpending(const COutput& output, const CoinEligibi
24692469
if (output.nDepth < (output.tx->IsFromMe(ISMINE_ALL) ? eligibility_filter.conf_mine : eligibility_filter.conf_theirs))
24702470
return false;
24712471

2472-
if (!mempool.TransactionWithinChainLimit(output.tx->GetHash(), eligibility_filter.max_ancestors, eligibility_filter.max_descendants))
2472+
int64_t ancestors, descendants;
2473+
mempool.GetTransactionAncestry(output.tx->GetHash(), ancestors, descendants);
2474+
if (ancestors >= eligibility_filter.max_ancestors || descendants >= eligibility_filter.max_descendants) {
24732475
return false;
2476+
}
24742477

24752478
return true;
24762479
}

0 commit comments

Comments
 (0)