mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
chainntfns/neutrinonotify: update driver to comply with BIP
This commit is contained in:
parent
1c408adcab
commit
50d88e7769
1 changed files with 6 additions and 5 deletions
|
@ -471,11 +471,12 @@ chainScan:
|
||||||
}
|
}
|
||||||
blockHash := header.BlockHash()
|
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.
|
// for this height.
|
||||||
extFilter, err := n.p2pNode.GetCFilter(blockHash, true)
|
regFilter, err := n.p2pNode.GetCFilter(blockHash,
|
||||||
|
wire.GCSFilterRegular)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
chainntnfs.Log.Errorf("unable to retrieve extended "+
|
chainntnfs.Log.Errorf("unable to retrieve regular "+
|
||||||
"filter for height=%v: %v", scanHeight, err)
|
"filter for height=%v: %v", scanHeight, err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -483,14 +484,14 @@ chainScan:
|
||||||
// If the block has no transactions other than the coinbase
|
// If the block has no transactions other than the coinbase
|
||||||
// transaction, then the filter may be nil, so we'll continue
|
// transaction, then the filter may be nil, so we'll continue
|
||||||
// forward int that case.
|
// forward int that case.
|
||||||
if extFilter == nil {
|
if regFilter == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// In the case that the filter exists, we'll attempt to see if
|
// In the case that the filter exists, we'll attempt to see if
|
||||||
// any element in it match our target txid.
|
// any element in it match our target txid.
|
||||||
key := builder.DeriveKey(&blockHash)
|
key := builder.DeriveKey(&blockHash)
|
||||||
match, err := extFilter.Match(key, targetHash[:])
|
match, err := regFilter.Match(key, targetHash[:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
chainntnfs.Log.Errorf("unable to query filter: %v", err)
|
chainntnfs.Log.Errorf("unable to query filter: %v", err)
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Add table
Reference in a new issue