refactor: Rely on returned value of GetCoin instead of parameter

Also removed the unused coin parameter of GetCoin.

Co-authored-by: Andrew Toth <andrewstoth@gmail.com>
This commit is contained in:
Lőrinc
2024-09-07 23:12:35 +02:00
parent 46dfbf169b
commit 4feaa28728
16 changed files with 85 additions and 113 deletions

View File

@@ -432,9 +432,8 @@ std::pair<CMutableTransaction, CAmount> TestChain100Setup::CreateValidTransactio
std::map<COutPoint, Coin> input_coins;
CAmount inputs_amount{0};
for (const auto& outpoint_to_spend : inputs) {
// - Use GetCoin to properly populate utxo_to_spend,
Coin utxo_to_spend;
assert(coins_cache.GetCoin(outpoint_to_spend, utxo_to_spend));
// Use GetCoin to properly populate utxo_to_spend
auto utxo_to_spend{coins_cache.GetCoin(outpoint_to_spend).value()};
input_coins.insert({outpoint_to_spend, utxo_to_spend});
inputs_amount += utxo_to_spend.out.nValue;
}