mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-03-10 04:31:07 +00:00
Merge #7491: wallet: Ignore MarkConflict if block hash is not known
40e7b61 wallet: Ignore MarkConflict if block hash is not known (Wladimir J. van der Laan)
This commit is contained in:
commit
c9da9c4bd8
@ -846,14 +846,19 @@ void CWallet::MarkConflicted(const uint256& hashBlock, const uint256& hashTx)
|
|||||||
{
|
{
|
||||||
LOCK2(cs_main, cs_wallet);
|
LOCK2(cs_main, cs_wallet);
|
||||||
|
|
||||||
CBlockIndex* pindex;
|
|
||||||
assert(mapBlockIndex.count(hashBlock));
|
|
||||||
pindex = mapBlockIndex[hashBlock];
|
|
||||||
int conflictconfirms = 0;
|
int conflictconfirms = 0;
|
||||||
if (chainActive.Contains(pindex)) {
|
if (mapBlockIndex.count(hashBlock)) {
|
||||||
conflictconfirms = -(chainActive.Height() - pindex->nHeight + 1);
|
CBlockIndex* pindex = mapBlockIndex[hashBlock];
|
||||||
|
if (chainActive.Contains(pindex)) {
|
||||||
|
conflictconfirms = -(chainActive.Height() - pindex->nHeight + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
assert(conflictconfirms < 0);
|
// 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
|
||||||
|
// case.
|
||||||
|
if (conflictconfirms >= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
// Do not flush the wallet here for performance reasons
|
// Do not flush the wallet here for performance reasons
|
||||||
CWalletDB walletdb(strWalletFile, "r+", false);
|
CWalletDB walletdb(strWalletFile, "r+", false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user