mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-08 03:41:42 +01:00
routing: abandon ChainNotifier for FilteredChainView
This commit modifies the routing package to no longer use the ChainNotifier for pruning the channel graph. Instead, we now use the FilteredChainView interface to more (from the ChannelRouter’s PoV) efficiently maintain the channel graph. Rather than scanning the _entire_ block manually, we now rely on the FilteredChainView to provide us with FilteredBlocks which include _only_ the relevant transactions that we care about.
This commit is contained in:
@@ -24,7 +24,7 @@ type testCtx struct {
|
||||
|
||||
chain *mockChain
|
||||
|
||||
notifier *mockNotifier
|
||||
chainView *mockChainView
|
||||
}
|
||||
|
||||
func createTestCtx(startingHeight uint32, testGraph ...string) (*testCtx, func(), error) {
|
||||
@@ -74,11 +74,11 @@ func createTestCtx(startingHeight uint32, testGraph ...string) (*testCtx, func()
|
||||
// any p2p functionality, the peer send and switch send messages won't
|
||||
// be populated.
|
||||
chain := newMockChain(startingHeight)
|
||||
notifier := newMockNotifier()
|
||||
chainView := newMockChainView()
|
||||
router, err := New(Config{
|
||||
Graph: graph,
|
||||
Chain: chain,
|
||||
Notifier: notifier,
|
||||
Graph: graph,
|
||||
Chain: chain,
|
||||
ChainView: chainView,
|
||||
SendToSwitch: func(_ *btcec.PublicKey,
|
||||
_ *lnwire.UpdateAddHTLC) ([32]byte, error) {
|
||||
return [32]byte{}, nil
|
||||
@@ -97,11 +97,11 @@ func createTestCtx(startingHeight uint32, testGraph ...string) (*testCtx, func()
|
||||
}
|
||||
|
||||
return &testCtx{
|
||||
router: router,
|
||||
graph: graph,
|
||||
aliases: aliasMap,
|
||||
chain: chain,
|
||||
notifier: notifier,
|
||||
router: router,
|
||||
graph: graph,
|
||||
aliases: aliasMap,
|
||||
chain: chain,
|
||||
chainView: chainView,
|
||||
}, cleanUp, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user