refactor: Add LIFETIMEBOUND to all (w)txid getters

Then, use the compiler warnings to create copies only where needed.

Also, fix iwyu includes while touching the includes.
This commit is contained in:
MarcoFalke
2023-10-27 12:38:21 +02:00
parent e789b30b25
commit faec889f93
6 changed files with 19 additions and 17 deletions

View File

@@ -40,7 +40,7 @@ static void addCoin(CoinsResult& coins,
tx.vout[0].nValue = nValue;
tx.vout[0].scriptPubKey = GetScriptForDestination(dest);
const uint256& txid = tx.GetHash();
const auto txid{tx.GetHash().ToUint256()};
LOCK(wallet.cs_wallet);
auto ret = wallet.mapWallet.emplace(std::piecewise_construct, std::forward_as_tuple(txid), std::forward_as_tuple(MakeTransactionRef(std::move(tx)), TxStateInactive{}));
assert(ret.second);