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

+1 -1
View File
@@ -18,7 +18,7 @@ type Config struct {
// Database is a wrapper around a namespace within boltdb reserved for
// ln-based wallet metadata. See the 'channeldb' package for further
// information.
Database *channeldb.DB
Database *channeldb.ChannelStateDB
// Notifier is used by in order to obtain notifications about funding
// transaction reaching a specified confirmation depth, and to catch
+4 -4
View File
@@ -327,13 +327,13 @@ func createTestWallet(tempTestDir string, miningNode *rpctest.Harness,
signer input.Signer, bio lnwallet.BlockChainIO) (*lnwallet.LightningWallet, error) {
dbDir := filepath.Join(tempTestDir, "cdb")
cdb, err := channeldb.Open(dbDir)
fullDB, err := channeldb.Open(dbDir)
if err != nil {
return nil, err
}
cfg := lnwallet.Config{
Database: cdb,
Database: fullDB.ChannelStateDB(),
Notifier: notifier,
SecretKeyRing: keyRing,
WalletController: wc,
@@ -2944,11 +2944,11 @@ func clearWalletStates(a, b *lnwallet.LightningWallet) error {
a.ResetReservations()
b.ResetReservations()
if err := a.Cfg.Database.Wipe(); err != nil {
if err := a.Cfg.Database.GetParentDB().Wipe(); err != nil {
return err
}
return b.Cfg.Database.Wipe()
return b.Cfg.Database.GetParentDB().Wipe()
}
func waitForMempoolTx(r *rpctest.Harness, txid *chainhash.Hash) error {
+2 -2
View File
@@ -323,7 +323,7 @@ func CreateTestChannels(chanType channeldb.ChannelType) (
RevocationStore: shachain.NewRevocationStore(),
LocalCommitment: aliceLocalCommit,
RemoteCommitment: aliceRemoteCommit,
Db: dbAlice,
Db: dbAlice.ChannelStateDB(),
Packager: channeldb.NewChannelPackager(shortChanID),
FundingTxn: testTx,
}
@@ -341,7 +341,7 @@ func CreateTestChannels(chanType channeldb.ChannelType) (
RevocationStore: shachain.NewRevocationStore(),
LocalCommitment: bobLocalCommit,
RemoteCommitment: bobRemoteCommit,
Db: dbBob,
Db: dbBob.ChannelStateDB(),
Packager: channeldb.NewChannelPackager(shortChanID),
}
+2 -2
View File
@@ -940,7 +940,7 @@ func createTestChannelsForVectors(tc *testContext, chanType channeldb.ChannelTyp
RevocationStore: shachain.NewRevocationStore(),
LocalCommitment: remoteCommit,
RemoteCommitment: remoteCommit,
Db: dbRemote,
Db: dbRemote.ChannelStateDB(),
Packager: channeldb.NewChannelPackager(shortChanID),
FundingTxn: tc.fundingTx.MsgTx(),
}
@@ -958,7 +958,7 @@ func createTestChannelsForVectors(tc *testContext, chanType channeldb.ChannelTyp
RevocationStore: shachain.NewRevocationStore(),
LocalCommitment: localCommit,
RemoteCommitment: localCommit,
Db: dbLocal,
Db: dbLocal.ChannelStateDB(),
Packager: channeldb.NewChannelPackager(shortChanID),
FundingTxn: tc.fundingTx.MsgTx(),
}