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

Improve sync and fix reorg #507

Open
wants to merge 4 commits into
base: 4.0
Choose a base branch
from
Open

Conversation

pnagurny
Copy link
Contributor

Sync uses a ReadStream. ReadStreams have their own built in queues. We shouldn't try to reinvent the wheel implementing our own queue. The ReadStream will add to its internal buffer by repeated calling _read() until the highWaterMark is met.

This PR also fixes reorg detection and finishes implementing the reorg integration test.

async.map(heights, function(height, next) {

if (height === 0) {
var block = new Block(self.bitcoind.genesisBuffer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with this removed, the require on line 9 is no longer used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed unnecessary require

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants