chainntnfs: update RegisterSpendNtfn to take the prev output script
In this commit, we update the RegisterSpendNtfn method to also take the prev output script of the item that we're attempting to watch for. This change is required due to the recent modifications in the neutrino protocol (BIP 158 + 157). With the new protocol, we'll match on the script, but then dispatch notifications based on the precise outpoint that matches.
This commit is contained in:
parent
07defe5f93
commit
7a0b7d2742
@ -38,7 +38,9 @@ type ChainNotifier interface {
|
|||||||
heightHint uint32) (*ConfirmationEvent, error)
|
heightHint uint32) (*ConfirmationEvent, error)
|
||||||
|
|
||||||
// RegisterSpendNtfn registers an intent to be notified once the target
|
// RegisterSpendNtfn registers an intent to be notified once the target
|
||||||
// outpoint is successfully spent within a transaction. The returned
|
// outpoint is successfully spent within a transaction. The script that
|
||||||
|
// the outpoint creates must also be specified. This allows this
|
||||||
|
// interface to be implemented by BIP 158-like filtering. The returned
|
||||||
// SpendEvent will receive a send on the 'Spend' transaction once a
|
// SpendEvent will receive a send on the 'Spend' transaction once a
|
||||||
// transaction spending the input is detected on the blockchain. The
|
// transaction spending the input is detected on the blockchain. The
|
||||||
// heightHint parameter is provided as a convenience to light clients.
|
// heightHint parameter is provided as a convenience to light clients.
|
||||||
@ -50,8 +52,8 @@ 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,
|
RegisterSpendNtfn(outpoint *wire.OutPoint, pkScript []byte,
|
||||||
heightHint uint32) (*SpendEvent, error)
|
heightHint uint32, mempool bool) (*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