@@ -414,7 +414,7 @@ std::shared_ptr<CWallet> RestoreWallet(WalletContext& context, const fs::path& b
414414const CWalletTx* CWallet::GetWalletTx (const uint256& hash) const
415415{
416416 AssertLockHeld (cs_wallet);
417- std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find (hash);
417+ const auto it = mapWallet.find (hash);
418418 if (it == mapWallet.end ())
419419 return nullptr ;
420420 return &(it->second );
@@ -551,7 +551,7 @@ std::set<uint256> CWallet::GetConflicts(const uint256& txid) const
551551 std::set<uint256> result;
552552 AssertLockHeld (cs_wallet);
553553
554- std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find (txid);
554+ const auto it = mapWallet.find (txid);
555555 if (it == mapWallet.end ())
556556 return result;
557557 const CWalletTx& wtx = it->second ;
@@ -642,7 +642,7 @@ bool CWallet::IsSpent(const COutPoint& outpoint) const
642642
643643 for (TxSpends::const_iterator it = range.first ; it != range.second ; ++it) {
644644 const uint256& wtxid = it->second ;
645- std::map<uint256, CWalletTx>::const_iterator mit = mapWallet.find (wtxid);
645+ const auto mit = mapWallet.find (wtxid);
646646 if (mit != mapWallet.end ()) {
647647 int depth = GetTxDepthInMainChain (mit->second );
648648 if (depth > 0 || (depth == 0 && !mit->second .isAbandoned ()))
@@ -1372,7 +1372,7 @@ CAmount CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const
13721372{
13731373 {
13741374 LOCK (cs_wallet);
1375- std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find (txin.prevout .hash );
1375+ const auto mi = mapWallet.find (txin.prevout .hash );
13761376 if (mi != mapWallet.end ())
13771377 {
13781378 const CWalletTx& prev = (*mi).second ;
@@ -1961,7 +1961,7 @@ bool CWallet::SignTransaction(CMutableTransaction& tx) const
19611961 // Build coins map
19621962 std::map<COutPoint, Coin> coins;
19631963 for (auto & input : tx.vin ) {
1964- std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find (input.prevout .hash );
1964+ const auto mi = mapWallet.find (input.prevout .hash );
19651965 if (mi == mapWallet.end () || input.prevout .n >= mi->second .tx ->vout .size ()) {
19661966 return false ;
19671967 }
0 commit comments