From 5e74023041ebc60bb4a6ae0c5ecd2d998874b478 Mon Sep 17 00:00:00 2001 From: Evan Vigil-McClanahan Date: Mon, 9 Aug 2021 13:32:48 -0700 Subject: [PATCH 1/2] sharply limit the amount of negative catchup possible --- src/miner.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.erl b/src/miner.erl index d7f0197de..9e733dd71 100644 --- a/src/miner.erl +++ b/src/miner.erl @@ -768,7 +768,7 @@ set_next_block_timer(State=#state{blockchain=Chain}) -> BlockTimeDeviation = case BlockTimeDeviation0 of N when N > 0 -> - catchup_time(abs(N)); + max(1, catchup_time(abs(N))); N -> -1 * catchup_time(abs(N)) end, From a53e8d812f72d1b179319a2a8eeb75fad513ea2a Mon Sep 17 00:00:00 2001 From: Evan Vigil-McClanahan Date: Wed, 11 Aug 2021 13:26:15 -0700 Subject: [PATCH 2/2] switch max and min for proper effect --- src/miner.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.erl b/src/miner.erl index 9e733dd71..c84774414 100644 --- a/src/miner.erl +++ b/src/miner.erl @@ -768,7 +768,7 @@ set_next_block_timer(State=#state{blockchain=Chain}) -> BlockTimeDeviation = case BlockTimeDeviation0 of N when N > 0 -> - max(1, catchup_time(abs(N))); + min(1, catchup_time(abs(N))); N -> -1 * catchup_time(abs(N)) end,