Class: BlockRecord

wallet~BlockRecord(hash, height, time)

Block Record

Constructor

new BlockRecord(hash, height, time)

Create a block record.

Parameters:
Name Type Description
hash Hash
height Number
time Number
Source:

Methods

(static) fromMeta(block) → {BlockRecord}

Instantiate wallet block from block meta.

Parameters:
Name Type Description
block BlockMeta
Source:
Returns:
Type
BlockRecord

add(hash) → {Boolean}

Add transaction to block record.

Parameters:
Name Type Description
hash Hash
Source:
Returns:
Type
Boolean

(private) fromMeta(block)

Instantiate wallet block from block meta.

Parameters:
Name Type Description
block BlockMeta
Source:

getJSON() → {Object}

Convert the block to a more json-friendly object.

Source:
Returns:
Type
Object

getSize() → {Number}

Get serialization size.

Source:
Returns:
Type
Number

(private) read(data)

Instantiate wallet block from serialized tip data.

Parameters:
Name Type Description
data Buffer
Source:

remove(hash) → {Boolean}

Remove transaction from block record.

Parameters:
Name Type Description
hash Hash
Source:
Returns:
Type
Boolean

toArray() → {Array.<Hash>}

Convert hashes set to an array.

Source:
Returns:
Type
Array.<Hash>

write() → {Buffer}

Serialize the wallet block as a tip (hash and height).

Source:
Returns:
Type
Buffer