|
|
@ -9,6 +9,7 @@ var BufferWriter = require('./encoding/bufferwriter'); |
|
|
|
var Hash = require('./crypto/hash'); |
|
|
|
var JSUtil = require('./util/js'); |
|
|
|
var Transaction = require('./transaction'); |
|
|
|
var $ = require('./util/preconditions'); |
|
|
|
|
|
|
|
/** |
|
|
|
* Instantiate a Block from a Buffer, JSON object, or Object with |
|
|
@ -96,6 +97,7 @@ Block.fromJSON = function fromJSON(json) { |
|
|
|
*/ |
|
|
|
Block._fromBufferReader = function _fromBufferReader(br) { |
|
|
|
var info = {}; |
|
|
|
$.checkState(!br.finished(), 'No block data received'); |
|
|
|
info.header = BlockHeader.fromBufferReader(br); |
|
|
|
var transactions = br.readVarintNum(); |
|
|
|
info.transactions = []; |
|
|
|