From 8357e86a4d6dbfc4a3635f4de9a2ec8c805139f0 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Thu, 26 Jul 2018 17:47:10 -0700 Subject: [PATCH] chain: match transaction against currently watched transactions In this commit, we extend the client's filtering process to also look at the set of currently watched transactions. The logic to watch for transaction hashes was previously there, but it was not used to filter against incoming transactions. --- chain/bitcoind_client.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chain/bitcoind_client.go b/chain/bitcoind_client.go index e0cb90a..a136c00 100644 --- a/chain/bitcoind_client.go +++ b/chain/bitcoind_client.go @@ -1217,6 +1217,14 @@ func (c *BitcoindClient) filterTx(tx *wire.MsgTx, } // If the transaction didn't pay to any of our watched addresses, we'll + // check if we're currently watching for the hash of this transaction. + if !isRelevant { + if _, ok := c.watchedTxs[tx.TxHash()]; ok { + isRelevant = true + } + } + + // If the transaction didn't pay to any of our watched hashes, we'll // check if it spends any of our watched outpoints. if !isRelevant { for _, in := range tx.TxIn {