Constructor
new BlockMeta(hash, height, time)
Create block meta.
Parameters:
Name | Type | Description |
---|---|---|
hash |
Hash | |
height |
Number | |
time |
Number |
- Source:
Methods
(static) fromEntry(entry) → {BlockMeta}
Instantiate block meta from chain entry.
Parameters:
Name | Type | Description |
---|---|---|
entry |
ChainEntry |
- Source:
Returns:
- Type
- BlockMeta
(static) fromHashAndTime(data, height) → {BlockMeta}
Instantiate block meta from hash and time.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer | |
height |
Number |
- Source:
Returns:
- Type
- BlockMeta
(private) fromEntry(entry)
Instantiate block meta from chain entry.
Parameters:
Name | Type | Description |
---|---|---|
entry |
ChainEntry |
- Source:
fromHashAndTime(data, height) → {BlockMeta}
Decode hash and time.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer | |
height |
Number |
- Source:
Returns:
- Type
- BlockMeta
fromJSON(json)
Instantiate block meta from json object.
Parameters:
Name | Type | Description |
---|---|---|
json |
Object |
- Source:
getJSON() → {Object}
Convert the block meta to a more json-friendly object.
- Source:
Returns:
- Type
- Object
getSize() → {Number}
Calculate size.
- Source:
Returns:
- Type
- Number
inject() → {BlockMeta}
Clone the block.
- Source:
Returns:
- Type
- BlockMeta
(private) read(data)
Instantiate block meta from serialized tip data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
toHashAndTime() → {Buffer}
Encode hash and time.
- Source:
Returns:
- Type
- Buffer
write() → {Buffer}
Serialize the block meta.
- Source:
Returns:
- Type
- Buffer