Home Reference Source
public class | source

MiniBlockchainLightProtocolForkSolver

Extends:

inheritForkSolver → MiniBlockchainLightProtocolForkSolver

Method Summary

Public Methods
public

async optionalProcess(socket: *, binarySearchResult: *, currentBlockchainLength: *, forkChainLength: *, forkChainStartingPoint: *)

Private Methods
private

async _calculateBlockRequestsForLight(socket: *, fork: *): {"difficultyAdditionalBlocks": *, "difficultyAdditionalBlockFirstDifficulty": *, "difficultyCalculationStarts": *}

private

async _calculateForkBinarySearch(socket: *, forkChainStartingPoint: *, forkChainLength: *, currentBlockchainLength: *): *

private

async _getLastBlocks(socket: *, heightRequired: *): {"position": *, "header": *}

private

async _solveFork(fork: *): *

Public Methods

public async optionalProcess(socket: *, binarySearchResult: *, currentBlockchainLength: *, forkChainLength: *, forkChainStartingPoint: *) source

Params:

NameTypeAttributeDescription
socket *
binarySearchResult *
currentBlockchainLength *
forkChainLength *
forkChainStartingPoint *

Private Methods

private async _calculateBlockRequestsForLight(socket: *, fork: *): {"difficultyAdditionalBlocks": *, "difficultyAdditionalBlockFirstDifficulty": *, "difficultyCalculationStarts": *} source

Params:

NameTypeAttributeDescription
socket *
fork *

Return:

{"difficultyAdditionalBlocks": *, "difficultyAdditionalBlockFirstDifficulty": *, "difficultyCalculationStarts": *}

private async _calculateForkBinarySearch(socket: *, forkChainStartingPoint: *, forkChainLength: *, currentBlockchainLength: *): * source

Params:

NameTypeAttributeDescription
socket *
forkChainStartingPoint *
forkChainLength *
currentBlockchainLength *

Return:

*

private async _getLastBlocks(socket: *, heightRequired: *): {"position": *, "header": *} source

Params:

NameTypeAttributeDescription
socket *
heightRequired *

Return:

{"position": *, "header": *}

private async _solveFork(fork: *): * source

Params:

NameTypeAttributeDescription
fork *

Return:

*