2015-12-16 14:38:21 -06:00
|
|
|
package chainntnfs
|
|
|
|
|
2016-01-06 13:01:50 -08:00
|
|
|
import "github.com/btcsuite/btcd/wire"
|
|
|
|
|
2015-12-16 14:38:21 -06:00
|
|
|
// TODO(roasbeef): finish
|
|
|
|
// * multiple backends for interface
|
|
|
|
// * btcd - websockets
|
|
|
|
// * core - rpc polling or ZeroMQ
|
|
|
|
// * direct p2p
|
|
|
|
// * random bitcoin API?
|
|
|
|
// * electrum?
|
2015-12-16 22:55:22 -06:00
|
|
|
// * SPV bloomfilter
|
2015-12-16 14:38:21 -06:00
|
|
|
// * other stuff maybe...
|
|
|
|
type ChainNotifier interface {
|
2016-01-06 13:01:50 -08:00
|
|
|
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()
|
2015-12-16 14:38:21 -06:00
|
|
|
}
|