Static Method Summary
Static Public Methods | ||
public static |
async isBetterProof(proof1: ChainProof, proof2: ChainProof, m: number): Promise<boolean> |
|
public static |
async manyPow(headers: Array<BlockHeader>): Promise<void> |
Static Protected Methods | ||
protected static |
async _getProofScore(chain: BlockChain, lca: Block, m: number): Promise<number> |
Constructor Summary
Public Constructor | ||
public |
constructor(store: ChainDataStore) |
Method Summary
Public Methods | ||
public |
|
|
public |
getBlockAt(height: number, includeBody: boolean): PromiseBlock> |
|
public |
async getBlockLocators(): Promise<Array<Hash>> |
|
public |
getNearestBlockAt(height: number, lower: boolean): PromiseBlock> |
|
public |
async getNextTarget(block: Block, next: Block): Promise<BigNumber> Computes the target value for the block after the given block or the head of this chain if no block is given. |
|
public |
getRawBlock(hash: Hash, includeForks: boolean): PromiseUint8Array> |
|
public |
async getSuccessorBlocks(block: Block): Promise<Array<Block>> |
Protected Methods | ||
protected |
async _extendChainProof(proof: ChainProof, header: BlockHeader, failOnBadness: boolean): Promise<ChainProof> |
|
protected |
async _getBlockProof(blockToProve: Block, knownBlock: Block): PromiseBlockChain> MUST be synchronized with .pushBlock() and variants! |
|
protected |
_getChainProof(): Promise<ChainProof> MUST be synchronized with .pushBlock() and variants! |
Inherited Summary
From class Observable | ||
public static get |
WILDCARD: string: string |
|
public |
bubble(observable: Observable, types: ...string) |
|
public |
fire(type: string, args: ...*): Promise |
|
public |
off(type: string, id: number) |
|
public |
on(type: string, callback: Function): number |
From class IBlockchain | ||
public get abstract |
|
|
public get abstract |
|
|
public get abstract |
height: number |
Static Public Methods
public static async isBetterProof(proof1: ChainProof, proof2: ChainProof, m: number): Promise<boolean> source
Params:
Name | Type | Attribute | Description |
proof1 | ChainProof | ||
proof2 | ChainProof | ||
m | number |
Return:
Promise<boolean> |
public static async manyPow(headers: Array<BlockHeader>): Promise<void> source
Params:
Name | Type | Attribute | Description |
headers | Array<BlockHeader> |
Return:
Promise<void> |
Static Protected Methods
protected static async _getProofScore(chain: BlockChain, lca: Block, m: number): Promise<number> source
Params:
Name | Type | Attribute | Description |
chain | BlockChain | ||
lca | Block | ||
m | number |
Return:
Promise<number> |
Public Constructors
public constructor(store: ChainDataStore) source
Override:
Observable#constructorParams:
Name | Type | Attribute | Description |
store | ChainDataStore |
Public Methods
public async getBlock(hash: Hash, includeForks: boolean, includeBody: boolean): PromiseBlock> source
Params:
Name | Type | Attribute | Description |
hash | Hash | ||
includeForks | boolean |
|
|
includeBody | boolean |
|
public getBlockAt(height: number, includeBody: boolean): PromiseBlock> source
Params:
Name | Type | Attribute | Description |
height | number | ||
includeBody | boolean |
|
public getNearestBlockAt(height: number, lower: boolean): PromiseBlock> source
Params:
Name | Type | Attribute | Description |
height | number | ||
lower | boolean |
|
public async getNextTarget(block: Block, next: Block): Promise<BigNumber> source
Computes the target value for the block after the given block or the head of this chain if no block is given.
public getRawBlock(hash: Hash, includeForks: boolean): PromiseUint8Array> source
Params:
Name | Type | Attribute | Description |
hash | Hash | ||
includeForks | boolean |
|
Return:
PromiseUint8Array> |
public async getSuccessorBlocks(block: Block): Promise<Array<Block>> source
Params:
Name | Type | Attribute | Description |
block | Block |
Protected Methods
protected async _extendChainProof(proof: ChainProof, header: BlockHeader, failOnBadness: boolean): Promise<ChainProof> source
Params:
Name | Type | Attribute | Description |
proof | ChainProof | ||
header | BlockHeader | ||
failOnBadness | boolean |
|
protected async _getBlockProof(blockToProve: Block, knownBlock: Block): PromiseBlockChain> source
MUST be synchronized with .pushBlock() and variants!
protected _getChainProof(): Promise<ChainProof> source
MUST be synchronized with .pushBlock() and variants!