chainntfs: flesh out initial draft of interface
* So far very simple, only notifications for tx confirmations, and outpoint spends. * Our two cases are: waiting for the funding transaction to reach a depth of N confirmations, and open channels being notified of the counterpart trying to cheat them by broadcasting an invalidated commitment tx.
This commit is contained in:
parent
f52b8370bc
commit
8154b96d67
@ -1,5 +1,7 @@
|
||||
package chainntnfs
|
||||
|
||||
import "github.com/btcsuite/btcd/wire"
|
||||
|
||||
// TODO(roasbeef): finish
|
||||
// * multiple backends for interface
|
||||
// * btcd - websockets
|
||||
@ -10,4 +12,14 @@ package chainntnfs
|
||||
// * SPV bloomfilter
|
||||
// * other stuff maybe...
|
||||
type ChainNotifier interface {
|
||||
RegisterConfirmationsNotification(txid *wire.ShaHash, numConfs uint32, trigger *NotificationTrigger) error
|
||||
RegisterSpendNotification(outpoint *wire.OutPoint, trigger *NotificationTrigger) error
|
||||
|
||||
Start() error
|
||||
Stop() error
|
||||
}
|
||||
|
||||
type NotificationTrigger struct {
|
||||
TriggerChan chan struct{}
|
||||
Callback func()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user