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
(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
toArray() → {Array.<Hash>}
Convert hashes set to an array.
- Source:
Returns:
- Type
- Array.<Hash>
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