@@ -414,7 +414,7 @@ std::shared_ptr<CWallet> RestoreWallet(WalletContext& context, const fs::path& b
414
414
const CWalletTx* CWallet::GetWalletTx (const uint256& hash) const
415
415
{
416
416
AssertLockHeld (cs_wallet);
417
- std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find (hash);
417
+ const auto it = mapWallet.find (hash);
418
418
if (it == mapWallet.end ())
419
419
return nullptr ;
420
420
return &(it->second );
@@ -551,7 +551,7 @@ std::set<uint256> CWallet::GetConflicts(const uint256& txid) const
551
551
std::set<uint256> result;
552
552
AssertLockHeld (cs_wallet);
553
553
554
- std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find (txid);
554
+ const auto it = mapWallet.find (txid);
555
555
if (it == mapWallet.end ())
556
556
return result;
557
557
const CWalletTx& wtx = it->second ;
@@ -642,7 +642,7 @@ bool CWallet::IsSpent(const COutPoint& outpoint) const
642
642
643
643
for (TxSpends::const_iterator it = range.first ; it != range.second ; ++it) {
644
644
const uint256& wtxid = it->second ;
645
- std::map<uint256, CWalletTx>::const_iterator mit = mapWallet.find (wtxid);
645
+ const auto mit = mapWallet.find (wtxid);
646
646
if (mit != mapWallet.end ()) {
647
647
int depth = GetTxDepthInMainChain (mit->second );
648
648
if (depth > 0 || (depth == 0 && !mit->second .isAbandoned ()))
@@ -1372,7 +1372,7 @@ CAmount CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const
1372
1372
{
1373
1373
{
1374
1374
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 );
1376
1376
if (mi != mapWallet.end ())
1377
1377
{
1378
1378
const CWalletTx& prev = (*mi).second ;
@@ -1961,7 +1961,7 @@ bool CWallet::SignTransaction(CMutableTransaction& tx) const
1961
1961
// Build coins map
1962
1962
std::map<COutPoint, Coin> coins;
1963
1963
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 );
1965
1965
if (mi == mapWallet.end () || input.prevout .n >= mi->second .tx ->vout .size ()) {
1966
1966
return false ;
1967
1967
}
0 commit comments