diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-01-01 18:26:46 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-01-01 18:28:01 +0000 |
commit | 5ee6f03742f7c14059da6139a9923c443668f4b0 (patch) | |
tree | 55d5c01dbf3632c66d447477783dc37e6d807efc /src/cryptonote_basic/hardfork.h | |
parent | blockchain: use the version passed as parameter, not a new one (diff) | |
download | monero-5ee6f03742f7c14059da6139a9923c443668f4b0.tar.xz |
blockchain: fix wrong hf version when popping multiple blocks
Since we keep track of the hf version in the db, we pick it up
from there instead of doing the full reorg call, which is quite
expensive
Diffstat (limited to 'src/cryptonote_basic/hardfork.h')
-rw-r--r-- | src/cryptonote_basic/hardfork.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cryptonote_basic/hardfork.h b/src/cryptonote_basic/hardfork.h index a63a66976..a3fc25dfa 100644 --- a/src/cryptonote_basic/hardfork.h +++ b/src/cryptonote_basic/hardfork.h @@ -150,6 +150,16 @@ namespace cryptonote bool reorganize_from_chain_height(uint64_t height); /** + * @brief called when one or more blocks are popped from the blockchain + * + * The current fork will be updated by looking up the db, + * which is much cheaper than recomputing everything + * + * @param new_chain_height the height of the chain after popping + */ + void on_block_popped(uint64_t new_chain_height); + + /** * @brief returns current state at the given time * * Based on the approximate time of the last known hard fork, |