Class: BlockRecord

wallet.BlockRecord

new BlockRecord(hash, height, ts)

Block Record

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

Methods

(static) fromMeta(block) → {BlockRecord}

Instantiate wallet block from block meta.

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

(static) fromRaw(data) → {BlockRecord}

Instantiate wallet block from serialized data.

Parameters:
Name Type Description
data Buffer
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:

(private) fromRaw(data)

Instantiate wallet block from serialized tip data.

Parameters:
Name Type Description
data Buffer
Source:

getSize() → {Number}

Get serialization size.

Source:
Returns:
Type
Number

remove(hash) → {Boolean}

Remove transaction from block record.

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

toJSON() → {Object}

Convert the block to a more json-friendly object.

Source:
Returns:
Type
Object

toRaw() → {Buffer}

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

Source:
Returns:
Type
Buffer