bitpay / bitcore-node

Extensible full node using Bitcore
https://bitcore.io/
Other
352 stars 644 forks source link

Improve sync and fix reorg #507

Open pnagurny opened 7 years ago

pnagurny commented 7 years ago

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.