lnd: introduce the utxoNursery which incubates outputs until maturity

This commit introduces the utxoNursery. The duty of the utxoNursery is
to watch over CSV-locked immature outputs until they’ve fully matured.
An output is mature once both its sequence lock indicated by the CSV op
code within its output has become active. Once an output is mature the
nursery sweeps the outputs in batches into the source wallet.

The utxoNursery executes its duties once a commitment transaction has
been broadcast on-chain.
This commit is contained in:
Olaoluwa Osuntokun
2016-09-12 12:37:51 -07:00
parent d0353b2864
commit bfa2a1d698
3 changed files with 317 additions and 0 deletions

4
log.go
View File

@@ -26,6 +26,7 @@ var (
ntfnLog = btclog.Disabled
chdbLog = btclog.Disabled
hswcLog = btclog.Disabled
utxnLog = btclog.Disabled
)
// subsystemLoggers maps each subsystem identifier to its associated logger.
@@ -39,6 +40,7 @@ var subsystemLoggers = map[string]btclog.Logger{
"CHDB": chdbLog,
"FNDG": fndgLog,
"HSWC": hswcLog,
"UTXN": utxnLog,
}
// useLogger updates the logger references for subsystemID to logger. Invalid
@@ -79,6 +81,8 @@ func useLogger(subsystemID string, logger btclog.Logger) {
case "HSWC":
hswcLog = logger
case "UTXN":
utxnLog = logger
}
}