Merge pull request #5642 from guggero/in-memory-graph
In-memory graph cache for faster pathfinding
This commit is contained in:
65 files changed
+2595
-1171
No files matched your search
+1
-1
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
|
||||
|
||||
@@ -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(),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user