Skip to content
Snippets Groups Projects
Commit 2e4d5b33 authored by Baptiste Lemoine's avatar Baptiste Lemoine Committed by ty kayn
Browse files

#1120 - :zap: - log message "Peer with zero endpoints that is not already...

#1120 - :zap:

 - log message "Peer with zero endpoints that is not already known" instead of throwing an error

Signed-off-by: default avatarBaptiste Lemoine <contact@cipherbliss.com>
parent 0f0aa710
No related branches found
No related tags found
1 merge request!1288Info peer
......@@ -160,9 +160,10 @@ export class PeeringService {
let found = await this.dal.getPeerOrNull(thePeer.pubkey);
let peerEntityOld = PeerDTO.fromJSONObject(found || thePeer)
if (!found && thePeerDTO.endpoints.length === 0) {
throw 'Peer with zero endpoints that is not already known'
}
else if(found){
let logMessage = 'Peer with zero endpoints that is not already known';
this.server.logger.info(logMessage);
} else if (found) {
// Already existing peer
const sp2 = found.block.split('-');
const previousBlockNumber = parseInt(sp2[0]);
......@@ -268,7 +269,8 @@ export class PeeringService {
/*********************
* Renew peer document
*********************/
// Choosing next based-block for our peer record: we basically want the most distant possible from current
// Choosing next based-block for our peer record: we basically want the most distant possible from
// current
let minBlock = current ? current.number - 30 : 0;
if (p1) {
// But if already have a peer record within this distance, we need to take the next block of it
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment