mirror of
https://github.com/monero-project/monero.git
synced 2025-07-23 06:20:50 -04:00
blockchain_db: fixup missing key images in early DB version
Early DB versions did not store key images for inputs if the
transaction spending them had no outputs (ie, all fee). This
is not correct, as this would allow these outputs to be double
spent. This was fixed in 533acc30ed
a few months ago, but databases having synced blocks 2021612 and
685498 with a faulty version will be missing those key images
in the spent keys database. This code checks for this, and adds
those key images if they are missing.
This commit is contained in:
parent
0252ffc37b
commit
a98e976f9e
7 changed files with 605 additions and 0 deletions
|
@ -293,6 +293,9 @@ bool Blockchain::init(BlockchainDB* db, const bool testnet)
|
|||
{
|
||||
}
|
||||
|
||||
// ensure we fixup anything we found and fix in the future
|
||||
m_db->fixup();
|
||||
|
||||
// check how far behind we are
|
||||
uint64_t top_block_timestamp = m_db->get_top_block_timestamp();
|
||||
uint64_t timestamp_diff = time(NULL) - top_block_timestamp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue