|
|
@ -43,6 +43,10 @@ Block._from = function _from(arg) { |
|
|
|
info = Block._fromJSON(arg); |
|
|
|
} else if (_.isObject(arg)) { |
|
|
|
info = { |
|
|
|
/** |
|
|
|
* @name Block#header |
|
|
|
* @type {BlockHeader} |
|
|
|
*/ |
|
|
|
header: arg.header, |
|
|
|
/** |
|
|
|
* @name Block#transactions |
|
|
@ -105,8 +109,8 @@ Block._fromBufferReader = function _fromBufferReader(br) { |
|
|
|
* @param {BufferReader} - A buffer reader of the block |
|
|
|
* @returns {Block} - An instance of block |
|
|
|
*/ |
|
|
|
Block.fromBufferReader = function fromBufferReader(br, opts) { |
|
|
|
var info = Block._fromBufferReader(br, opts); |
|
|
|
Block.fromBufferReader = function fromBufferReader(br) { |
|
|
|
var info = Block._fromBufferReader(br); |
|
|
|
return new Block(info); |
|
|
|
}; |
|
|
|
|
|
|
@ -114,8 +118,8 @@ Block.fromBufferReader = function fromBufferReader(br, opts) { |
|
|
|
* @param {Buffer} - A buffer of the block |
|
|
|
* @returns {Block} - An instance of block |
|
|
|
*/ |
|
|
|
Block.fromBuffer = function fromBuffer(buf, opts) { |
|
|
|
return Block.fromBufferReader(BufferReader(buf), opts); |
|
|
|
Block.fromBuffer = function fromBuffer(buf) { |
|
|
|
return Block.fromBufferReader(BufferReader(buf)); |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|