aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-12-25 22:02:07 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-12-25 22:02:07 +0000
commitd837c0ca906ed94e423eba10cc4dc7b3185cb842 (patch)
tree62e1271783a1742e8103a69d647700875d291989 /src/cryptonote_core/blockchain.cpp
parentblockchain: add a missing validity check to rollback_blockchain_switching (diff)
downloadmonero-d837c0ca906ed94e423eba10cc4dc7b3185cb842.tar.xz
blockchain: fix switch to alternative blockchain for more than one block
When rolling over more than one block, the db height will decrease, but the split height should be constant, as per the original code.
Diffstat (limited to '')
-rw-r--r--src/cryptonote_core/blockchain.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index f3111a966..128dd9e48 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -797,7 +797,7 @@ bool Blockchain::switch_to_alternative_blockchain(std::list<blocks_ext_by_hash::
// rollback_blockchain_switching should be moved to two different
// functions: rollback and apply_chain, but for now we pretend it is
// 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
// about them again so we can immediately dismiss them, but needs some