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:
1 parent
f52b8370bc
commit
8154b96d67
1 file changed
+12
@@ -1,5 +1,7 @@
|
|||||||
package chainntnfs
|
package chainntnfs
|
||||||
|
|
||||||
|
import "github.com/btcsuite/btcd/wire"
|
||||||
|
|
||||||
// TODO(roasbeef): finish
|
// TODO(roasbeef): finish
|
||||||
// * multiple backends for interface
|
// * multiple backends for interface
|
||||||
// * btcd - websockets
|
// * btcd - websockets
|
||||||
@@ -10,4 +12,14 @@ package chainntnfs
|
|||||||
// * SPV bloomfilter
|
// * SPV bloomfilter
|
||||||
// * other stuff maybe...
|
// * other stuff maybe...
|
||||||
type ChainNotifier interface {
|
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()
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user