From 8c7f73b099a9d342ec08945ff16fa14d53779686 Mon Sep 17 00:00:00 2001 From: sairajzero Date: Sun, 15 Jan 2023 00:12:06 +0530 Subject: [PATCH] logging --- lib/services/header/index.js | 1 + lib/services/p2p/index.js | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/services/header/index.js b/lib/services/header/index.js index 5a586919..d3640c11 100644 --- a/lib/services/header/index.js +++ b/lib/services/header/index.js @@ -721,6 +721,7 @@ HeaderService.prototype._startSync = function() { self._syncUnresponsive = true; self._syncCheckInterval = setInterval(() => { //check the best height + console.debug("bestHeight check", self._bestHeight, self._p2p._bcoin._bcoin.pool.chain.height) if(self._bestHeight < self._p2p._bcoin._bcoin.pool.chain.height) self._bestHeight = self._p2p._bcoin._bcoin.pool.chain.height; //call sync again if unresponsive diff --git a/lib/services/p2p/index.js b/lib/services/p2p/index.js index f645f2d6..eee8e30e 100644 --- a/lib/services/p2p/index.js +++ b/lib/services/p2p/index.js @@ -97,8 +97,7 @@ P2P.prototype.getHeaders = function(filter) { var peer = this._getPeer(); var headerFilter = this._setResourceFilter(filter, 'headers'); - - console.debug("p2p:getHeaders", peer, headerFilter); + console.debug("p2p:getHeaders", peer.host, peer.port, peer.bestHeight, JSON.stringify(headerFilter)); peer.sendMessage(this.messages.GetHeaders(headerFilter)); }; @@ -235,7 +234,7 @@ P2P.prototype._getBestHeight = function() { if (this._peers[i].bestHeight > maxHeight) { maxHeight = this._peers[i].bestHeight; this._peer = this._peers[i]; - console.debug("Swapping best peer", this._peer, maxHeight); + console.debug("Swapping best peer", this._peer.host, this._peer.port, maxHeight); } } return maxHeight;