Merge pull request #889 from wpaulino/chainnotifier-updates

chainntnfs: add incremental update notifications within ChainNotifier
This commit is contained in:
Olaoluwa Osuntokun
2018-04-12 19:21:26 -07:00
committed by GitHub
6 changed files with 445 additions and 87 deletions

View File

@@ -88,8 +88,10 @@ type TxConfirmation struct {
// ConfirmationEvent encapsulates a confirmation notification. With this struct,
// callers can be notified of: the instance the target txid reaches the targeted
// number of confirmations, and also in the event that the original txid becomes
// disconnected from the blockchain as a result of a re-org.
// number of confirmations, how many confirmations are left for the target txid
// to be fully confirmed at every new block height, and also in the event that
// the original txid becomes disconnected from the blockchain as a result of a
// re-org.
//
// Once the txid reaches the specified number of confirmations, the 'Confirmed'
// channel will be sent upon fulfilling the notification.
@@ -103,6 +105,11 @@ type ConfirmationEvent struct {
// details of the channel's confirmation.
Confirmed chan *TxConfirmation // MUST be buffered.
// Updates is a channel that will sent upon, at every incremental
// confirmation, how many confirmations are left to declare the
// transaction as fully confirmed.
Updates chan uint32 // MUST be buffered.
// TODO(roasbeef): all goroutines on ln channel updates should also
// have a struct chan that's closed if funding gets re-org out. Need
// to sync, to request another confirmation event ntfn, then re-open