Class: UndoCoins

coins.UndoCoins

new UndoCoins()

UndoCoins 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).

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

Methods

(static) fromRaw(data) → {UndoCoins}

Instantiate undo coins from serialized data.

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

apply(view, outpoint)

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

Parameters:
Name Type Description
view CoinView
outpoint Outpoint
Source:

commit() → {Buffer}

Render the undo coins.

Source:
Returns:
Type
Buffer

(private) fromRaw(data) → {UndoCoins}

Inject properties from serialized data.

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

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(entry)

Push coin entry onto undo coin array.

Parameters:
Name Type Description
entry CoinEntry
Source:

top() → {UndoCoin}

Retrieve the last undo coin.

Source:
Returns:
Type
UndoCoin

toRaw() → {Buffer}

Serialize all undo coins.

Source:
Returns:
Type
Buffer