diff --git a/routing/chainview/interface.go b/routing/chainview/interface.go index 036d90c0a..cfa9fccf4 100644 --- a/routing/chainview/interface.go +++ b/routing/chainview/interface.go @@ -3,6 +3,7 @@ package chainview import ( "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" + "github.com/lightningnetwork/lnd/channeldb" ) // FilteredChainView represents a subscription to a certain subset of the @@ -42,7 +43,7 @@ type FilteredChainView interface { // relevant notifications are dispatched, meaning blocks with a height // lower than the best known height might be sent over the // FilteredBlocks() channel. - UpdateFilter(ops []wire.OutPoint, updateHeight uint32) error + UpdateFilter(ops []channeldb.EdgePoint, updateHeight uint32) error // FilterBlock takes a block hash, and returns a FilteredBlocks which // is the result of applying the current registered UTXO sub-set on the diff --git a/routing/chainview/interface_test.go b/routing/chainview/interface_test.go index c563434a9..5ab054df4 100644 --- a/routing/chainview/interface_test.go +++ b/routing/chainview/interface_test.go @@ -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)