Merge pull request #5642 from guggero/in-memory-graph

In-memory graph cache for faster pathfinding
This commit is contained in:
Oliver Gugger authored and GitHub committed 2021-10-04 11:20:23 +02:00
commit 692ea25295
65 files changed
+2595 -1171

No files matched your search

+7 -5
View File
@@ -262,7 +262,7 @@ func (n *testNode) AddNewChannel(channel *channeldb.OpenChannel,
}
}
func createTestWallet(cdb *channeldb.DB, netParams *chaincfg.Params,
func createTestWallet(cdb *channeldb.ChannelStateDB, netParams *chaincfg.Params,
notifier chainntnfs.ChainNotifier, wc lnwallet.WalletController,
signer input.Signer, keyRing keychain.SecretKeyRing,
bio lnwallet.BlockChainIO,
@@ -330,11 +330,13 @@ func createTestFundingManager(t *testing.T, privKey *btcec.PrivateKey,
}
dbDir := filepath.Join(tempTestDir, "cdb")
cdb, err := channeldb.Open(dbDir)
fullDB, err := channeldb.Open(dbDir)
if err != nil {
return nil, err
}
cdb := fullDB.ChannelStateDB()
keyRing := &mock.SecretKeyRing{
RootKey: alicePrivKey,
}
@@ -923,12 +925,12 @@ func assertDatabaseState(t *testing.T, node *testNode,
}
state, _, err = node.fundingMgr.getChannelOpeningState(
fundingOutPoint)
if err != nil && err != ErrChannelNotFound {
if err != nil && err != channeldb.ErrChannelNotFound {
t.Fatalf("unable to get channel state: %v", err)
}
// If we found the channel, check if it had the expected state.
if err != ErrChannelNotFound && state == expectedState {
if err != channeldb.ErrChannelNotFound && state == expectedState {
// Got expected state, return with success.
return
}
@@ -1166,7 +1168,7 @@ func assertErrChannelNotFound(t *testing.T, node *testNode,
}
state, _, err = node.fundingMgr.getChannelOpeningState(
fundingOutPoint)
if err == ErrChannelNotFound {
if err == channeldb.ErrChannelNotFound {
// Got expected state, return with success.
return
} else if err != nil {