Class: PolicyEstimator

mempool.PolicyEstimator

new PolicyEstimator(minRelay, network)

Estimator for fees and priority.

Parameters:
Name Type Description
minRelay Rate
network Network | NetworkType
Source:

Methods

(static) fromRaw(data, minRelay, network) → {PolicyEstimator}

Instantiate a policy estimator from serialized data.

Parameters:
Name Type Description
data Buffer
minRelay Rate
network Network | NetworkType
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

getSize() → {Number}

Get serialization size.

Source:
Returns:
Type
Number

(private) init()

Initialize the estimator.

Source:

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