From 68a65488a03f97b69b7dba96f099778501fbba64 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Fri, 8 Feb 2019 17:25:18 -0800 Subject: [PATCH] [FIX] integer divide by zero error Signed-off-by: Leo Chen --- node/node_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node_handler.go b/node/node_handler.go index f5caf7a47..78ecdce68 100644 --- a/node/node_handler.go +++ b/node/node_handler.go @@ -135,7 +135,7 @@ func (node *Node) messageHandler(content []byte) { blockCount++ } - if blockCount != 0 { + if blockCount != 0 && txCount != 0 { avgBlockSizeInBytes = avgBlockSizeInBytes / common.StorageSize(blockCount) avgTxSize = avgTxSize / txCount }