src/blockchain/chainentry.js
function ChainEntry(options) {
  if (!(this instanceof ChainEntry))
    return new ChainEntry(options);

  this.hash = encoding.NULL_HASH;
  this.version = 1;
  this.prevBlock = encoding.NULL_HASH;
  this.merkleRoot = encoding.NULL_HASH;
  this.time = 0;
  this.bits = 0;
  this.nonce = 0;
  this.height = 0;
  this.chainwork = ZERO;

  if (options)
    this.fromOptions(options);
}
function ChainEntry(options) {
  if (!(this instanceof ChainEntry))
    return new ChainEntry(options);

  this.hash = encoding.NULL_HASH;
  this.version = 1;
  this.prevBlock = encoding.NULL_HASH;
  this.merkleRoot = encoding.NULL_HASH;
  this.time = 0;
  this.bits = 0;
  this.nonce = 0;
  this.height = 0;
  this.chainwork = ZERO;

  if (options)
    this.fromOptions(options);
}
function ChainEntry ( options ) { if ( ! ( this instanceof ChainEntry ) ) return new ChainEntry ( options ) ; this . hash = encoding . NULL_HASH ; this . version = 1 ; this . prevBlock = encoding . NULL_HASH ; this . merkleRoot = encoding . NULL_HASH ; this . time = 0 ; this . bits = 0 ; this . nonce = 0 ; this . height = 0 ; this . chainwork = ZERO ; if ( options ) this . fromOptions ( options ) ; }
Represents an entry in the chain. Unlike
other bitcoin fullnodes, we store the
chainwork _with_ the entry in order to
avoid reading the entire chain index on
boot and recalculating the chainworks.
@alias module:blockchain.ChainEntry
@constructor
@param {Object?} options
@property {Hash} hash
@property {Number} version - Transaction version. Note that wmcc_core reads
versions as unsigned even though they are signed at the protocol level.
This value will never be negative.
@property {Hash} prevBlock
@property {Hash} merkleRoot
@property {Number} time
@property {Number} bits
@property {Number} nonce
@property {Number} height
@property {BN} chainwork
@property {ReversedHash} rhash - Reversed block hash (uint256le).
Represents an entry in the chain . Unlike other bitcoin fullnodes we store the chainwork _with_ the entry in order to avoid reading the entire chain index on boot and recalculating the chainworks .