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