Skip to content

Commit

Permalink
CheckEphemeralSpends: only compute txid of tx when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
instagibbs committed Nov 13, 2024
1 parent 36f5eff commit cbf1a47
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/policy/ephemeral_policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ std::optional<Txid> CheckEphemeralSpends(const Package& package, CFeeRate dust_r
}

for (const auto& tx : package) {
Txid txid = tx->GetHash();
std::unordered_set<Txid, SaltedTxidHasher> processed_parent_set;
std::unordered_set<COutPoint, SaltedOutpointHasher> unspent_parent_dust;

Expand Down Expand Up @@ -70,7 +69,7 @@ std::optional<Txid> CheckEphemeralSpends(const Package& package, CFeeRate dust_r
}

if (!unspent_parent_dust.empty()) {
return txid;
return tx->GetHash();
}
}

Expand Down

0 comments on commit cbf1a47

Please sign in to comment.