lnd.xprv/chainntfs/chainntfs.go
Olaoluwa Osuntokun 8154b96d67 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.
2016-01-14 23:56:11 -08:00

26 lines
641 B
Go

package chainntnfs
import "github.com/btcsuite/btcd/wire"
// TODO(roasbeef): finish
// * multiple backends for interface
// * btcd - websockets
// * core - rpc polling or ZeroMQ
// * direct p2p
// * random bitcoin API?
// * electrum?
// * 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()
}