|
|
@ -1,5 +1,7 @@ |
|
|
|
var BufferReader = require('./bufferreader'); |
|
|
|
var BufferWriter = require('./bufferwriter'); |
|
|
|
'use strict'; |
|
|
|
|
|
|
|
var BufferReader = require('./protocol/bufferreader'); |
|
|
|
var BufferWriter = require('./protocol/bufferwriter'); |
|
|
|
|
|
|
|
var Blockheader = function Blockheader(version, prevblockidbuf, merklerootbuf, time, bits, nonce) { |
|
|
|
if (!(this instanceof Blockheader)) |
|
|
@ -20,7 +22,7 @@ var Blockheader = function Blockheader(version, prevblockidbuf, merklerootbuf, t |
|
|
|
var obj = version; |
|
|
|
this.set(obj); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
Blockheader.prototype.set = function(obj) { |
|
|
|
this.version = typeof obj.version !== 'undefined' ? obj.version : this.version; |
|
|
|