Class: PolicyEstimator

mempool~PolicyEstimator(loggernullable)

Policy Estimator Estimator for fees and priority.

Constructor

new PolicyEstimator(loggernullable)

Create an estimator.

Parameters:
Name Type Attributes Description
logger Logger <nullable>
Source:

Members

(static, constant) VERSION :Number

Serialization version.

Type:
  • Number
Source:

Methods

(static) fromRaw(data, loggernullable) → {PolicyEstimator}

Instantiate a policy estimator from serialized data.

Parameters:
Name Type Attributes Description
data Buffer
logger Logger <nullable>
Source:
Returns:
Type
PolicyEstimator

estimateFee(targetopt, smartopt) → {Rate}

Estimate a fee rate.

Parameters:
Name Type Attributes Default Description
target Number <optional>
1

Confirmation target.

smart Boolean <optional>
true

Smart estimation.

Source:
Returns:
Type
Rate

estimatePriority(targetopt, smartopt) → {Number}

Estimate a priority.

Parameters:
Name Type Attributes Default Description
target Number <optional>
1

Confirmation target.

smart Boolean <optional>
true

Smart estimation.

Source:
Returns:
Type
Number

(private) fromRaw(data) → {PolicyEstimator}

Inject properties from serialized data.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
PolicyEstimator

getSize() → {Number}

Get serialization size.

Source:
Returns:
Type
Number

(private) init()

Initialize the estimator.

Source:

inject(estimator) → {PolicyEstimator}

Inject properties from estimator.

Parameters:
Name Type Description
estimator PolicyEstimator
Source:
Returns:
Type
PolicyEstimator

isFeePoint(fee, priority) → {Boolean}

Test whether a fee should be used for calculation.

Parameters:
Name Type Description
fee Amount
priority Number
Source:
Returns:
Type
Boolean

isPriPoint(fee, priority) → {Boolean}

Test whether a priority should be used for calculation.

Parameters:
Name Type Description
fee Amount
priority Number
Source:
Returns:
Type
Boolean

processBlock(height, entries, current)

Process a block of transaction entries being removed from the mempool.

Parameters:
Name Type Description
height Number

Block height.

entries Array.<MempoolEntry>
current Boolean

Whether the chain is synced.

Source:

processBlockTX(height, entry)

Process an entry being removed from the mempool.

Parameters:
Name Type Description
height Number

Block height.

entry MempoolEntry
Source:

processTX(entry, current)

Process a mempool entry.

Parameters:
Name Type Description
entry MempoolEntry
current Boolean

Whether the chain is synced.

Source:

removeTX(hash)

Stop tracking a tx. Remove from map.

Parameters:
Name Type Description
hash Hash
Source:

reset()

Reset the estimator.

Source:

toRaw() → {Buffer}

Serialize the estimator.

Source:
Returns:
Type
Buffer