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:
Olaoluwa Osuntokun 2018-07-17 18:47:01 -07:00
parent 07defe5f93
commit 7a0b7d2742
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -38,7 +38,9 @@ type ChainNotifier interface {
heightHint uint32) (*ConfirmationEvent, error)
// 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
// transaction spending the input is detected on the blockchain. The
// 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
// spend of the same outpoint MUST be supported.
RegisterSpendNtfn(outpoint *wire.OutPoint,
heightHint uint32) (*SpendEvent, error)
RegisterSpendNtfn(outpoint *wire.OutPoint, pkScript []byte,
heightHint uint32, mempool bool) (*SpendEvent, error)
// RegisterBlockEpochNtfn registers an intent to be notified of each
// new block connected to the tip of the main chain. The returned