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:
moneromooo-monero 2015-12-06 20:48:17 +00:00
parent 0252ffc37b
commit a98e976f9e
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
7 changed files with 605 additions and 0 deletions

View file

@ -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;