Constructor
new BlockRecord(hashopt, heightopt, timeopt)
Create a block record.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
hash |
Hash |
<optional> |
|
height |
Number |
<optional> |
|
time |
Number |
<optional> |
- 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
read(br) → {this}
Instantiate wallet block from serialized tip data.
Parameters:
Name | Type | Description |
---|---|---|
br |
bio.BufferReader |
- Source:
Returns:
- Type
- this
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(bw) → {BufioWriter}
Serialize the wallet block as a tip (hash and height).
Parameters:
Name | Type | Description |
---|---|---|
bw |
BufioWriter |
- Source:
Returns:
- Type
- BufioWriter