Skip to content

Commit

Permalink
wallet::MarkConflicted remove blockIndex and there by cs_main lock de…
Browse files Browse the repository at this point in the history
…pendency.
  • Loading branch information
furszy committed Mar 10, 2021
1 parent 239d6a2 commit 1bd97ca
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1203,16 +1203,9 @@ bool CWallet::AbandonTransaction(const uint256& hashTx)

void CWallet::MarkConflicted(const uint256& hashBlock, int conflicting_height, const uint256& hashTx)
{
LOCK2(cs_main, cs_wallet);

int conflictconfirms = 0;
if (mapBlockIndex.count(hashBlock)) {
CBlockIndex* pindex = mapBlockIndex[hashBlock];
if (chainActive.Contains(pindex)) {
conflictconfirms = -(chainActive.Height() - pindex->nHeight + 1);
}
}
LOCK(cs_wallet);

int conflictconfirms = (m_last_block_processed_height - conflicting_height + 1) * -1;
// If number of conflict confirms cannot be determined, this means
// that the block is still unknown or not yet part of the main chain,
// for example when loading the wallet during a reindex. Do nothing in that
Expand Down

0 comments on commit 1bd97ca

Please sign in to comment.