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.
This commit is contained in:
parent
00428d5828
commit
8357e86a4d
1 changed files with 8 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue