Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add neutrino mode client support #1160

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: added headers first sync
  • Loading branch information
masterchief164 committed Jun 28, 2023
commit 093b18f3ded5f8bcd13913ad30e9d1e1f6cf6e89
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