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:

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

(private) read(data) → {UndoCoins}

Inject properties from serialized data.

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

write() → {Buffer}

Serialize all undo coins.

Source:
Returns:
Type
Buffer