Class: UndoCoins

coins.UndoCoins()

Undo Coins Coins need to be resurrected from somewhere during a reorg. The undo coins store all spent coins in a single record per block (in a compressed format).

Constructor

new UndoCoins()

Create undo coins.

Properties:
Name Type Description
items Array.<UndoCoin>
Source:

Members

items :Array.<CoinEntry>

Type:
  • Array.<CoinEntry>
Source:

Methods

apply(view, prevout)

Re-apply undo coins to a view, effectively unspending them.

Parameters:
Name Type Description
view CoinView
prevout Outpoint
Source:

commit() → {Buffer}

Render the undo coins.

Source:
Returns:
Type
Buffer

getSize() → {Number}

Calculate undo coins size.

Source:
Returns:
Type
Number

isEmpty() → {Boolean}

Test whether the undo coins have any members.

Source:
Returns:
Type
Boolean

push(coin) → {Number}

Push coin entry onto undo coin array.

Parameters:
Name Type Description
coin CoinEntry
Source:
Returns:
Type
Number

read(br) → {this}

Inject properties from serialized data.

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

write(bw) → {BufioWriter}

Serialize all undo coins.

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