Open xloem opened 3 years ago
I've made https://github.com/xloem/bitcore-p2p-bsv to help me (or others) move through this particular hurdle.
EDIT: reviewing the history, it looks like the change in bsv-p2p was just a quick way to handle having removed BufferUtil
and is incorrect. I think it should be 32 bytes of zeros.
There are some changes from bitcore that seem to be missing from the history. How was the original upload produced? I'm currently running into an issue from this difference:
bitcore-p2p has
stop = BufferUtil.NULL_HASH
: https://github.com/bitpay/bitcore-p2p/blob/master/lib/messages/utils.js#L110but bsv-p2p has
stop = Buffer.alloc(1)
: https://github.com/deanmlittle/bsv-p2p/blob/master/lib/messages/utils.js#L112in bsv-p2p, this unrecorded change causes a crash at https://github.com/deanmlittle/bsv-p2p/blob/master/lib/messages/commands/getheaders.js#L57 where the length is not 32:
if (this.stop.length !== 32) { throw new Error('Invalid hash length: ' + this.stop.length); }