From a5a988c32098d8a3f56d4c284680f20aeed2fccb Mon Sep 17 00:00:00 2001 From: Izumi Hoshino Date: Thu, 3 Aug 2023 23:23:33 +0900 Subject: [PATCH] Fixed an issue where insufficient block interval was used to calculate average block time (#15921) --- chia/rpc/full_node_rpc_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chia/rpc/full_node_rpc_api.py b/chia/rpc/full_node_rpc_api.py index a435016ebf57..75c6d6ba9dc3 100644 --- a/chia/rpc/full_node_rpc_api.py +++ b/chia/rpc/full_node_rpc_api.py @@ -56,7 +56,7 @@ async def get_average_block_time( if newer_block.height < 1: return None - prev_height = uint32(max(newer_block.height - 1, newer_block.height - height_distance)) + prev_height = uint32(max(1, newer_block.height - height_distance)) prev_hash = blockchain.height_to_hash(prev_height) assert prev_hash prev_block = await blockchain.get_block_record_from_db(prev_hash)