From a33dcdd400c5af96ab6fc254602a1fa89802e031 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 830335ff4..d3044993a 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