This commit is contained in:
sairajzero 2023-01-15 00:12:06 +05:30
parent 836f2e1f84
commit 8c7f73b099
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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;