We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent da78039 commit 46f0e30Copy full SHA for 46f0e30
src/wallet/wallet.cpp
@@ -977,7 +977,8 @@ bool CWallet::LoadToWallet(CWalletTx& wtxIn)
977
// If tx hasn't been reorged out of chain while wallet being shutdown
978
// change tx status to UNCONFIRMED and reset hashBlock/nIndex.
979
if (!wtxIn.m_confirm.hashBlock.IsNull()) {
980
- CBlockIndex* pindex = mapBlockIndex[wtxIn.m_confirm.hashBlock];
+ auto it = mapBlockIndex.find(wtxIn.m_confirm.hashBlock);
981
+ CBlockIndex* pindex = it == mapBlockIndex.end() ? nullptr : it->second;
982
if (!pindex || !chainActive.Contains(pindex)) {
983
wtxIn.setUnconfirmed();
984
wtxIn.m_confirm.hashBlock = UINT256_ZERO;
0 commit comments