Constructor
new MemBlock()
Create a mem block.
Extends:
- AbstractBlock
- Source:
Extends
- AbstractBlock
Methods
(static) isMemBlock(obj) → {Boolean}
Test whether an object is a MemBlock.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object |
- Source:
Returns:
- Type
- Boolean
decode(data)
Inject properties from serialized data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
encode() → {Buffer}
Return serialized block data.
- Source:
Returns:
- Type
- Buffer
getCoinbaseHeight() → {Number}
Retrieve the coinbase height from the coinbase input script.
- Source:
Returns:
height (-1 if not present).
- Type
- Number
getSize() → {Number}
Get the full block size.
- Source:
Returns:
- Type
- Number
isMemory() → {Boolean}
Test whether the block is a memblock.
- Source:
Returns:
- Type
- Boolean
padding(size) → {Buffer}
Retrieve deterministically random padding.
Parameters:
Name | Type | Description |
---|---|---|
size |
Number |
- Source:
Returns:
- Type
- Buffer
(private) parseCoinbaseHeight() → {Number}
Parse the coinbase height from the coinbase input script.
- Source:
Returns:
height (-1 if not present).
- Type
- Number
powHash() → {Buffer}
Calculate PoW hash.
- Source:
Returns:
- Type
- Buffer
read(br)
Inject properties from buffer reader.
Parameters:
Name | Type | Description |
---|---|---|
br |
bio.BufferReader |
- Source:
toBlock() → {Block}
Parse the serialized block data and create an actual Block.
- Source:
Throws:
Parse error
Returns:
- Type
- Block
toHead() → {Buffer}
Serialize the block headers.
- Source:
Returns:
- Type
- Buffer
toHeaders() → {Headers}
Convert the block to a headers object.
- Source:
Returns:
- Type
- Headers
toPrehead() → {Buffer}
Serialize the block headers.
- Source:
Returns:
- Type
- Buffer
verifyBody() → {Boolean}
Verify the block.
- Source:
Returns:
- Type
- Boolean
write(bw) → {BufioWriter}
Return serialized block data.
Parameters:
Name | Type | Description |
---|---|---|
bw |
BufioWriter |
- Source:
Returns:
- Type
- BufioWriter