From 6fff5bb231eb98492a2e7e0e8390794e267d3a70 Mon Sep 17 00:00:00 2001 From: EggPool Date: Tue, 12 Nov 2019 19:52:46 +0100 Subject: [PATCH] Lower checkpoints to /30 blocks after HF --- essentials.py | 15 ++++++++++++--- node.py | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/essentials.py b/essentials.py index 711520f..1e21c84 100644 --- a/essentials.py +++ b/essentials.py @@ -21,7 +21,11 @@ from polysign.signer import SignerType from polysign.signerfactory import SignerFactory -__version__ = "0.0.6" +__version__ = "0.0.7" + +""" +0.0.7 : decrease checkpoint limit to 30 blocks at 1450000 (meaning max 59 blocks rollback) +""" """ For temp. code compatibility, dup code moved to polysign module @@ -118,8 +122,13 @@ def round_down(number, order): def checkpoint_set(node): - node.checkpoint = round_down(node.last_block, 1000) - 1000 - node.logger.app_log.warning(f"Checkpoint set to {node.checkpoint}") + limit = 30 + if node.last_block < 1450000: + limit = 1000 + checkpoint = round_down(node.last_block, limit) - limit + if checkpoint != node.checkpoint: + node.checkpoint = checkpoint + node.logger.app_log.warning(f"Checkpoint set to {node.checkpoint}") def ledger_balance3(address, cache, db_handler): diff --git a/node.py b/node.py index 06d9594..d2f3bb3 100644 --- a/node.py +++ b/node.py @@ -11,7 +11,7 @@ # issues with db? perhaps you missed a commit() or two -VERSION = "4.4.0.2" # Post fork candidate 2 +VERSION = "4.4.0.3" # Post fork candidate 3 import functools import glob