routing/chainview: modify the UpdateFilter method to take a channeldb.EdgePoint
In this commit, we update the existing UpdateFilter method to take the new channeldb.EdgePoint struct in place of the prior wire.OutPoint. We must do this as the caller now typically has this type due to the preparation to enable lnd to be able to be compatible with the new neutrino protocol.
This commit is contained in:
2 files changed
+15
-6
No files matched your search
@@ -21,6 +21,7 @@ import (
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/lightninglabs/neutrino"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/ltcsuite/ltcd/btcjson"
|
||||
|
||||
"github.com/btcsuite/btcwallet/walletdb"
|
||||
@@ -238,8 +239,11 @@ func testFilterBlockNotifications(node *rpctest.Harness,
|
||||
t.Fatalf("unable to get current height: %v", err)
|
||||
}
|
||||
|
||||
// Now we'll add both output to the current filter.
|
||||
filter := []wire.OutPoint{*outPoint1, *outPoint2}
|
||||
// Now we'll add both outpoints to the current filter.
|
||||
filter := []channeldb.EdgePoint{
|
||||
{targetScript, *outPoint1},
|
||||
{targetScript, *outPoint2},
|
||||
}
|
||||
err = chainView.UpdateFilter(filter, uint32(currentHeight))
|
||||
if err != nil {
|
||||
t.Fatalf("unable to update filter: %v", err)
|
||||
@@ -382,8 +386,9 @@ func testUpdateFilterBackTrack(node *rpctest.Harness,
|
||||
|
||||
// After the block has been mined+notified we'll update the filter with
|
||||
// a _prior_ height so a "rewind" occurs.
|
||||
filter := []wire.OutPoint{*outPoint}
|
||||
|
||||
filter := []channeldb.EdgePoint{
|
||||
{testScript, *outPoint},
|
||||
}
|
||||
err = chainView.UpdateFilter(filter, uint32(currentHeight))
|
||||
if err != nil {
|
||||
t.Fatalf("unable to update filter: %v", err)
|
||||
@@ -496,7 +501,10 @@ func testFilterSingleBlock(node *rpctest.Harness, chainView FilteredChainView,
|
||||
|
||||
// Now we'll manually trigger filtering the block generated above.
|
||||
// First, we'll add the two outpoints to our filter.
|
||||
filter := []wire.OutPoint{*outPoint1, *outPoint2}
|
||||
filter := []channeldb.EdgePoint{
|
||||
{testScript, *outPoint1},
|
||||
{testScript, *outPoint2},
|
||||
}
|
||||
err = chainView.UpdateFilter(filter, uint32(currentHeight))
|
||||
if err != nil {
|
||||
t.Fatalf("unable to update filter: %v", err)
|
||||
|
||||
Reference in new issue
Block a user