Skip to content

Commit

Permalink
chainntfns/neutrinonotify: update driver to comply with BIP
Browse files Browse the repository at this point in the history
  • Loading branch information
aakselrod authored and Roasbeef committed Nov 3, 2017
1 parent 1c408ad commit 50d88e7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions chainntnfs/neutrinonotify/neutrino.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,26 +471,27 @@ chainScan:
}
blockHash := header.BlockHash()

// With the hash computed, we can now fetch the extended filter
// With the hash computed, we can now fetch the basic filter
// for this height.
extFilter, err := n.p2pNode.GetCFilter(blockHash, true)
regFilter, err := n.p2pNode.GetCFilter(blockHash,
wire.GCSFilterRegular)
if err != nil {
chainntnfs.Log.Errorf("unable to retrieve extended "+
chainntnfs.Log.Errorf("unable to retrieve regular "+
"filter for height=%v: %v", scanHeight, err)
return false
}

// If the block has no transactions other than the coinbase
// transaction, then the filter may be nil, so we'll continue
// forward int that case.
if extFilter == nil {
if regFilter == nil {
continue
}

// In the case that the filter exists, we'll attempt to see if
// any element in it match our target txid.
key := builder.DeriveKey(&blockHash)
match, err := extFilter.Match(key, targetHash[:])
match, err := regFilter.Match(key, targetHash[:])
if err != nil {
chainntnfs.Log.Errorf("unable to query filter: %v", err)
return false
Expand Down

0 comments on commit 50d88e7

Please sign in to comment.