From 7c3a9fb6e9329c788063012ad34a6a341f3efe37 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Mon, 9 Nov 2020 00:18:18 +0000 Subject: [PATCH] make sure blocks aren't skewed to future --- js/onionr-blocks.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/onionr-blocks.js b/js/onionr-blocks.js index f5646cd..b7fbbee 100644 --- a/js/onionr-blocks.js +++ b/js/onionr-blocks.js @@ -33,4 +33,7 @@ function verifyTime(time){ if ((epoch - time) > maxBlockAge){ throw new Error("Block is too old") } + if (time > (epoch + 60)){ + throw new Error("Block is skewed to the future") + } }