fix needing to reindex chainstate after pegin

This commit is contained in:
Tom Trevethan 2026-04-20 11:30:09 +01:00
parent c1820ce4b9
commit 697f03a17e
No known key found for this signature in database
2 changed files with 3 additions and 2 deletions

View file

@ -37,7 +37,8 @@ bool CCoinsViewDB::NeedsUpgrade()
// DB_COINS was deprecated in v0.15.0, commit
// 1088b02f0ccd7358d2b7076bb9e122d59d502d02
cursor->Seek(std::make_pair(DB_COINS, uint256{}));
return cursor->Valid();
std::pair<unsigned char, uint256> key;
return cursor->Valid() && cursor->GetKey(key) && key.first == DB_COINS;
}
namespace {