Skip to content

Commit

Permalink
feat: added headers first sync
Browse files Browse the repository at this point in the history
  • Loading branch information
masterchief164 committed Jun 28, 2023
1 parent d213418 commit 093b18f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/net/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -1674,12 +1674,6 @@ class Pool extends EventEmitter {
if (this.checkpoints)
return;

if (this.options.neutrino) {
const locator = await this.chain.getLocator();
this.sendLocator(locator, peer);
return;
}

this.logger.debug(
'Received %d block hashes from peer (%s).',
hashes.length,
Expand Down Expand Up @@ -2185,6 +2179,7 @@ class Pool extends EventEmitter {
const headers = packet.items;

if (!this.checkpoints && !this.options.neutrino)
// todo add support for checkpoints
return;

if (!this.syncing)
Expand Down Expand Up @@ -2260,7 +2255,7 @@ class Pool extends EventEmitter {
peer.blockTime = Date.now();

// Request the blocks we just added.
if (checkpoint && !this.options.neutrino) {
if (checkpoint) {
this.headerChain.shift();
this.resolveHeaders(peer);
return;
Expand Down

0 comments on commit 093b18f

Please sign in to comment.