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
7 changed files with 605 additions and 0 deletions

View File

@@ -405,6 +405,10 @@ private:
uint64_t get_output_global_index(const uint64_t& amount, const uint64_t& index);
void checkpoint_worker() const;
void check_open() const;
//
// fix up anything that may be wrong due to past bugs
virtual void fixup();
bool m_run_checkpoint;
std::unique_ptr<boost::thread> m_checkpoint_thread;
typedef bdb_safe_buffer<void *> bdb_safe_buffer_t;