Class: MempoolEntry

mempool~MempoolEntry(options)

Mempool Entry Represents a mempool entry.

Constructor

new MempoolEntry(options)

Create a mempool entry.

Parameters:
Name Type Description
options Object
Properties
Name Type Description
tx TX

Transaction in mempool.

height Number

Entry height.

priority Number

Entry priority.

time Number

Entry time.

value Amount

Value of on-chain coins.

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

Methods

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

Create a mempool entry from a TX.

Parameters:
Name Type Description
tx TX
height Number

Entry height.

Source:
Returns:
Type
MempoolEntry

(private) fromOptions(options)

Inject properties from options object.

Parameters:
Name Type Description
options Object
Source:

(private) fromTX(tx, height)

Inject properties from transaction.

Parameters:
Name Type Description
tx TX
height Number
Source:

getDeltaFee() → {Amount}

Get delta fee.

Source:
Returns:
Type
Amount

getDeltaRate() → {Rate}

Calculate delta fee rate.

Source:
Returns:
Type
Rate

getDescRate() → {Rate}

Calculate fee cumulative descendant rate.

Source:
Returns:
Type
Rate

getFee() → {Amount}

Get fee.

Source:
Returns:
Type
Amount

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

(private) read(data) → {MempoolEntry}

Inject properties from serialized data.

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

txid() → {Hash}

Calculate reverse transaction hash.

Source:
Returns:
Type
Hash

write() → {Buffer}

Serialize entry to a buffer.

Source:
Returns:
Type
Buffer