From 1577230a126a7891b887ef65cfbe3358110e7497 Mon Sep 17 00:00:00 2001 From: cgeek Date: Thu, 30 Apr 2020 16:18:23 +0200 Subject: [PATCH] [mod] head-watcher: add pubkey in messages --- src/lib/watchers/bma/head-watcher.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/watchers/bma/head-watcher.ts b/src/lib/watchers/bma/head-watcher.ts index 47c1787..75a9c04 100644 --- a/src/lib/watchers/bma/head-watcher.ts +++ b/src/lib/watchers/bma/head-watcher.ts @@ -4,7 +4,7 @@ import {WS2PHead} from "duniter/app/modules/ws2p/lib/WS2PCluster"; function handleLateness(confHead: ConfHead, mainHeads: HeadMetric[], observedHead?: TrameWS2P) { if (!mainHeads.length) { - throw 'No consensus found' + throw 'Observed pubkey ${confHead.observedPubkey}: no consensus found' } if (!observedHead) { throw `Observed pubkey ${confHead.observedPubkey} not found in heads` @@ -14,7 +14,7 @@ function handleLateness(confHead: ConfHead, mainHeads: HeadMetric[], observedHea // Check how much late is the node const farAwayHeads = mainHeads.filter(h => h.blockNumber - observedHead.blockNumber >= confHead.maxLateBlocks) if (farAwayHeads.length) { - throw `Observed pubkey is too late for ${farAwayHeads.length} consensus by at least ${confHead.maxLateBlocks}` + throw `Observed pubkey ${confHead.observedPubkey} is too late for ${farAwayHeads.length} consensus by at least ${confHead.maxLateBlocks}` } } }