blockchain: fix rollback height in failure path

The original code rolls back to split_height, which can be
different from the current height if a block was succesfully
added but a subsequent one fails.
This commit is contained in:
moneromooo-monero 2015-08-23 11:21:39 +01:00
parent 1208cc8fa4
commit a33dcdd400
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
1 changed files with 1 additions and 1 deletions

View File

@ -768,7 +768,7 @@ bool Blockchain::switch_to_alternative_blockchain(std::list<blocks_ext_by_hash::
// rollback_blockchain_switching should be moved to two different // rollback_blockchain_switching should be moved to two different
// functions: rollback and apply_chain, but for now we pretend it is // functions: rollback and apply_chain, but for now we pretend it is
// just the latter (because the rollback was done above). // just the latter (because the rollback was done above).
rollback_blockchain_switching(disconnected_chain, m_db->height()); rollback_blockchain_switching(disconnected_chain, split_height);
// FIXME: Why do we keep invalid blocks around? Possibly in case we hear // FIXME: Why do we keep invalid blocks around? Possibly in case we hear
// about them again so we can immediately dismiss them, but needs some // about them again so we can immediately dismiss them, but needs some