chainntnfs: add Updates channel field to ConfirmationEvent
In this commit, we add a new Updates channel to our ConfirmationEvent struct. This channel will be used to deliver updates to a subscriber of a confirmation notification. Updates will be delivered at every incremental height of the chain with the number of confirmations remaining for the transaction to be considered confirmed by the subscriber.
This commit is contained in:
6 files changed
+48
-23
No files matched your search
@@ -85,8 +85,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.
|
||||
@@ -100,6 +102,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
|
||||
|
||||
Reference in new issue
Block a user