wallet: fix, make 'total_effective_amount' optional actually optional

this is not needed for the remaining commits but good to fix
and came up in #25269 review.

Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
This commit is contained in:
stratospherandfurszy committed 2026-02-06 09:36:19 +05:30
1 parent 9d2b8fddad
commit fefa3be782
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -223,7 +223,7 @@ void CoinsResult::Erase(const std::unordered_set<COutPoint, SaltedOutpointHasher
// update cached amounts // update cached amounts
total_amount -= coin.txout.nValue; total_amount -= coin.txout.nValue;
if (coin.HasEffectiveValue()) total_effective_amount = *total_effective_amount - coin.GetEffectiveValue(); if (coin.HasEffectiveValue() && total_effective_amount.has_value()) total_effective_amount = *total_effective_amount - coin.GetEffectiveValue();
return true; return true;
}); });
vec.erase(remove_it, vec.end()); vec.erase(remove_it, vec.end());
+1 -1
View File
@@ -65,7 +65,7 @@ private:
/** Sum of all available coins raw value */ /** Sum of all available coins raw value */
CAmount total_amount{0}; CAmount total_amount{0};
/** Sum of all available coins effective value (each output value minus fees required to spend it) */ /** Sum of all available coins effective value (each output value minus fees required to spend it) */
std::optional<CAmount> total_effective_amount{0}; std::optional<CAmount> total_effective_amount;
}; };
struct CoinFilterParams { struct CoinFilterParams {