Skip to content

Commit

Permalink
wallet: Do not try to abandon coinstakes during a reindex
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Feb 7, 2024
1 parent 1751061 commit b86e4a7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1953,6 +1953,14 @@ CWallet::ScanResult CWallet::ScanForWalletTransactions(const uint256& start_bloc
void CWallet::AbandonOrphanedCoinstakes()
{
LOCK(cs_wallet);

// Blackcoin: m_last_block_processed_height can be < 0
// when loading the wallet during a reindex. Do nothing in that
// case.
if (m_last_block_processed_height < 0) {
return;
}

for (std::pair<const uint256, CWalletTx>& item : mapWallet) {
const uint256& wtxid = item.first;
CWalletTx& wtx = item.second;
Expand Down

0 comments on commit b86e4a7

Please sign in to comment.