Class: MempoolEntry

mempool.MempoolEntry(optionsopt)

Mempool Entry Represents a mempool entry.

Constructor

new MempoolEntry(optionsopt)

Create a mempool entry.

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Description
tx TX

Transaction in mempool.

height Number

Entry height.

priority Number

Entry priority.

time Number

Entry time.

value AmountValue

Value of on-chain coins.

Properties:
Name Type Description
tx TX
height Number
priority Number
time Number
value Amount
Source:

Methods

(static) fromTX(tx, view, height) → {MempoolEntry}

Create a mempool entry from a TX.

Parameters:
Name Type Description
tx TX
view CoinView
height Number

Entry height.

Source:
Returns:
Type
MempoolEntry

fromOptions(options)

Inject properties from options object.

Parameters:
Name Type Description
options Object
Source:

fromTX(tx, view, height)

Inject properties from transaction.

Parameters:
Name Type Description
tx TX
view CoinView
height Number
Source:

getDeltaFee() → {AmountValue}

Get delta fee.

Source:
Returns:
Type
AmountValue

getDeltaRate() → {Rate}

Calculate delta fee rate.

Source:
Returns:
Type
Rate

getDescRate() → {Rate}

Calculate fee cumulative descendant rate.

Source:
Returns:
Type
Rate

getFee() → {AmountValue}

Get fee.

Source:
Returns:
Type
AmountValue

getPriority(height) → {Number}

Calculate priority, taking into account the entry height delta, modified size, and chain value.

Parameters:
Name Type Description
height Number
Source:
Returns:

Priority.

Type
Number

getRate() → {Rate}

Calculate fee rate.

Source:
Returns:
Type
Rate

getSize() → {Number}

Get entry serialization size.

Source:
Returns:
Type
Number

hash() → {Hash}

Calculate transaction hash.

Source:
Returns:
Type
Hash

isFree(height) → {Boolean}

Test whether the entry is free with the current priority (calculated by current height).

Parameters:
Name Type Description
height Number
Source:
Returns:
Type
Boolean

memUsage() → {Number}

Calculate the memory usage of a transaction. Note that this only calculates the JS heap size. Sizes of buffers are ignored (the v8 heap is what we care most about). All numbers are based on the output of v8 heap snapshots of TX objects.

Source:
Returns:

Usage in bytes.

Type
Number

read(br) → {this}

Inject properties from serialized data.

Parameters:
Name Type Description
br bio.BufferReader
Source:
Returns:
Type
this

txid() → {HexHash}

Calculate reverse transaction hash.

Source:
Returns:
Type
HexHash

write(bw) → {BufioWriter}

Serialize entry to a buffer.

Parameters:
Name Type Description
bw BufioWriter
Source:
Returns:
Type
BufioWriter