Similarly as with kvdb.View this commits adds a reset closure to the
kvdb.Update call in order to be able to reset external state if the
underlying db backend needs to retry the transaction.
This commit adds a reset() closure to the kvdb.View function which will
be called before each retry (including the first) of the view
transaction. The reset() closure can be used to reset external state
(eg slices or maps) where the view closure puts intermediate results.
The explicit `bbolt` dep is gone, as we depend on `kvdb`, which is
actually `walletdb`, which has its own module that defines the proper
`bbolt` version.
Previously, nursery generated and published its own sweep txes. It
stored the sweep tx in nursery_store to prevent a new tx with a new
sweep address from being generated on restart.
In this commit, sweep generation and publication is removed from nursery
and delegated to the sweeper. Also the confirmation notification is
received from the sweeper.
In this commit, we aim to address a lingering bug caused by a Late
Registration of a kid output from preschool to kindergarten. In this
scenario, an output is promoted, but *after* it’s target maturity
period, meaning that we won’t graduate the output until we restart. To
avoid this, we’ll now detect this case, and bump the graduation height
by one to ensure that when the new block arrives, we properly handle
the output.
This commit removes the use of a purge height from the nursery
store, instead tracking the last graduated height. This serves
to indicate the last height that the nursery store successfully
graduated. It also adds a method for retrieving the set of all active
heights below a particular threshold, e.g. the last graduated height,
allowing the utxo nursery to replay these heights on startup for the
specific purpose of re-registering for confirmations of outputs in the
height index.
Also includes:
* improved error handling when pruning channels
* more aggressively signals errors when enumerating height outputs
* removes use of variadic functions in Incubate, AwardDiplomas
* renames AwardDiplomas to GraduateKinder
* short circuits channel maturity test after finding 1 non-grad output
* replaces prefixed outputs in height buckets with files, instead of
empty buckets
This commit introduces a new type called a NurseryStore
which abstract many of the persistent operations required
by the utxo nursery. The code in this commit is
intentionally introduced as dead code, as the utxo
nursery will later be modified to hook into the new
database. It is designed to support incubation of
commitment and htlc outputs, and includes full
chain segmentation!