Skip to content

Commit 62016b3

Browse files
committed
Use std::ranges for ephemeral policy checks
1 parent 3ed930a commit 62016b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/policy/ephemeral_policy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
bool HasDust(const CTransaction& tx, CFeeRate dust_relay_rate)
99
{
10-
return std::any_of(tx.vout.cbegin(), tx.vout.cend(), [&](const auto& output) { return IsDust(output, dust_relay_rate); });
10+
return std::ranges::any_of(tx.vout, [&](const auto& output) { return IsDust(output, dust_relay_rate); });
1111
}
1212

1313
bool PreCheckEphemeralTx(const CTransaction& tx, CFeeRate dust_relay_rate, CAmount base_fee, CAmount mod_fee, TxValidationState& state)
@@ -22,7 +22,7 @@ bool PreCheckEphemeralTx(const CTransaction& tx, CFeeRate dust_relay_rate, CAmou
2222

2323
std::optional<Txid> CheckEphemeralSpends(const Package& package, CFeeRate dust_relay_rate, const CTxMemPool& tx_pool)
2424
{
25-
if (!Assume(std::all_of(package.cbegin(), package.cend(), [](const auto& tx){return tx != nullptr;}))) {
25+
if (!Assume(std::ranges::all_of(package, [](const auto& tx){return tx != nullptr;}))) {
2626
// Bail out of spend checks if caller gave us an invalid package
2727
return std::nullopt;
2828
}

0 commit comments

Comments
 (0)