chainntnfs: update bitcoind and btcd backends to match new spend ntfn API
This commit is contained in:
parent
7a0b7d2742
commit
6781b17056
@ -577,7 +577,7 @@ type spendCancel struct {
|
|||||||
// across the 'Spend' channel. The heightHint should represent the earliest
|
// across the 'Spend' channel. The heightHint should represent the earliest
|
||||||
// height in the chain where the transaction could have been spent in.
|
// height in the chain where the transaction could have been spent in.
|
||||||
func (b *BitcoindNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
|
func (b *BitcoindNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
|
||||||
heightHint uint32) (*chainntnfs.SpendEvent, error) {
|
pkScript []byte, heightHint uint32) (*chainntnfs.SpendEvent, error) {
|
||||||
|
|
||||||
ntfn := &spendNotification{
|
ntfn := &spendNotification{
|
||||||
targetOutpoint: outpoint,
|
targetOutpoint: outpoint,
|
||||||
|
@ -695,7 +695,7 @@ type spendCancel struct {
|
|||||||
// across the 'Spend' channel. The heightHint should represent the earliest
|
// across the 'Spend' channel. The heightHint should represent the earliest
|
||||||
// height in the chain where the transaction could have been spent in.
|
// height in the chain where the transaction could have been spent in.
|
||||||
func (b *BtcdNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
|
func (b *BtcdNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
|
||||||
heightHint uint32) (*chainntnfs.SpendEvent, error) {
|
pkScript []byte, heightHint uint32) (*chainntnfs.SpendEvent, error) {
|
||||||
|
|
||||||
ntfn := &spendNotification{
|
ntfn := &spendNotification{
|
||||||
targetOutpoint: outpoint,
|
targetOutpoint: outpoint,
|
||||||
@ -710,6 +710,7 @@ func (b *BtcdNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
|
|||||||
case b.notificationRegistry <- ntfn:
|
case b.notificationRegistry <- ntfn:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(roasbeef): update btcd rescan logic to also use both
|
||||||
if err := b.chainConn.NotifySpent([]*wire.OutPoint{outpoint}); err != nil {
|
if err := b.chainConn.NotifySpent([]*wire.OutPoint{outpoint}); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ type ChainNotifier interface {
|
|||||||
// NOTE: Dispatching notifications to multiple clients subscribed to a
|
// NOTE: Dispatching notifications to multiple clients subscribed to a
|
||||||
// spend of the same outpoint MUST be supported.
|
// spend of the same outpoint MUST be supported.
|
||||||
RegisterSpendNtfn(outpoint *wire.OutPoint, pkScript []byte,
|
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
|
// RegisterBlockEpochNtfn registers an intent to be notified of each
|
||||||
// new block connected to the tip of the main chain. The returned
|
// new block connected to the tip of the main chain. The returned
|
||||||
|
Loading…
Reference in New Issue
Block a user