From b1a775b29e35b1e7ca997bf3cb8245779f934d11 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 31 Jul 2018 21:28:27 -0700 Subject: [PATCH] chainntnfs/neutrinonotify: update async conf dispatch to use scripts --- chainntnfs/neutrinonotify/neutrino.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/chainntnfs/neutrinonotify/neutrino.go b/chainntnfs/neutrinonotify/neutrino.go index 17014fe91..f612ef1ce 100644 --- a/chainntnfs/neutrinonotify/neutrino.go +++ b/chainntnfs/neutrinonotify/neutrino.go @@ -10,6 +10,7 @@ import ( "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/rpcclient" + "github.com/btcsuite/btcd/txscript" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" "github.com/btcsuite/btcutil/gcs/builder" @@ -317,8 +318,19 @@ func (n *NeutrinoNotifier) notificationDispatcher() { defer n.wg.Done() confDetails, err := n.historicalConfDetails( - msg.TxID, currentHeight, - msg.heightHint, + msg.TxID, msg.pkScript, currentHeight, msg.heightHint, + ) + if err != nil { + chainntnfs.Log.Error(err) + } + + // We'll map the script into an address + // type so we can instruct neutrino to + // match if the transaction containing + // the script is found in a block. + params := n.p2pNode.ChainParams() + _, addrs, _, err := txscript.ExtractPkScriptAddrs( + msg.pkScript, ¶ms, ) if err != nil { chainntnfs.Log.Error(err)