chainntnfs: update bitcoind and btcd backends to match new spend ntfn API

This commit is contained in:
Olaoluwa Osuntokun committed 2018-07-31 21:28:53 -07:00
1 parent 7a0b7d2742
commit 6781b17056
3 files changed
+4 -3

No files matched your search

+1 -1
View File
@@ -577,7 +577,7 @@ type spendCancel struct {
// across the 'Spend' channel. The heightHint should represent the earliest
// height in the chain where the transaction could have been spent in.
func (b *BitcoindNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
heightHint uint32) (*chainntnfs.SpendEvent, error) {
pkScript []byte, heightHint uint32) (*chainntnfs.SpendEvent, error) {
ntfn := &spendNotification{
targetOutpoint: outpoint,
+2 -1
View File
@@ -695,7 +695,7 @@ type spendCancel struct {
// across the 'Spend' channel. The heightHint should represent the earliest
// height in the chain where the transaction could have been spent in.
func (b *BtcdNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
heightHint uint32) (*chainntnfs.SpendEvent, error) {
pkScript []byte, heightHint uint32) (*chainntnfs.SpendEvent, error) {
ntfn := &spendNotification{
targetOutpoint: outpoint,
@@ -710,6 +710,7 @@ func (b *BtcdNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
case b.notificationRegistry <- ntfn:
}
// TODO(roasbeef): update btcd rescan logic to also use both
if err := b.chainConn.NotifySpent([]*wire.OutPoint{outpoint}); err != nil {
return nil, err
}
+1 -1
View File
@@ -53,7 +53,7 @@ type ChainNotifier interface {
// NOTE: Dispatching notifications to multiple clients subscribed to a
// spend of the same outpoint MUST be supported.
RegisterSpendNtfn(outpoint *wire.OutPoint, pkScript []byte,
heightHint uint32, mempool bool) (*SpendEvent, error)
heightHint uint32) (*SpendEvent, error)
// RegisterBlockEpochNtfn registers an intent to be notified of each
// new block connected to the tip of the main chain. The returned