From b845599c80e26e3262d11b3d02df39bb83888223 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 23 Aug 2015 11:21:39 +0100 Subject: [PATCH] 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. --- src/cryptonote_core/blockchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index fa8d1aaf9..997a771e6 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -768,7 +768,7 @@ bool Blockchain::switch_to_alternative_blockchain(std::listheight()); + rollback_blockchain_switching(disconnected_chain, split_height); // 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