fix Header message
This commit is contained in:
parent
13361ea210
commit
a58d76c875
@ -159,7 +159,7 @@ describe('Integration with ' + network.name + ' bitcoind', function() {
|
||||
});
|
||||
var from = [blockHash[network.name]];
|
||||
var stop = stopBlock[network.name];
|
||||
it.only('gets headers', function(cb) {
|
||||
it('gets headers', function(cb) {
|
||||
connect(function(peer) {
|
||||
peer.once('headers', function(message) {
|
||||
(message instanceof Messages.Headers).should.equal(true);
|
||||
|
||||
@ -653,11 +653,15 @@ Headers.prototype.fromBuffer = function(payload) {
|
||||
$.checkArgument(payload && payload.length > 0, 'No data found to create Headers message');
|
||||
var parser = new BufferReader(payload);
|
||||
var count = parser.readVarintNum();
|
||||
console.log(count);
|
||||
|
||||
this.headers = [];
|
||||
for (var i = 0; i < count; i++) {
|
||||
var header = BlockHeaderModel.fromBufferReader(parser);
|
||||
this.headers.push(header);
|
||||
var txn_count = parser.readUInt8(); // this value is always 0
|
||||
$.checkState(txn_count === 0, 'txn_count should always be 0');
|
||||
|
||||
}
|
||||
this._checkFinished(parser);
|
||||
return this;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user