mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-09 07:08:25 +02:00
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:
@@ -223,7 +223,7 @@ void CoinsResult::Erase(const std::unordered_set<COutPoint, SaltedOutpointHasher
|
||||
|
||||
// update cached amounts
|
||||
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;
|
||||
});
|
||||
vec.erase(remove_it, vec.end());
|
||||
|
||||
Reference in New Issue
Block a user