Skip to content

Commit d81faf9

Browse files
authored
Merge pull request #1345 from lightninglabs/root-cache-sync-issue
tapdb: fixes another issue with the syncer cache
2 parents 4208aa7 + f5f9122 commit d81faf9

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

itest/tapd_harness.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ type harnessOpts struct {
126126
// sqliteDatabaseFilePath is the path to the SQLite database file to
127127
// use.
128128
sqliteDatabaseFilePath *string
129+
130+
// disableSyncCache is a flag that can be set to true to disable the
131+
// universe syncer cache.
132+
disableSyncCache bool
129133
}
130134

131135
type harnessOption func(*harnessOpts)
@@ -283,6 +287,10 @@ func newTapdHarness(t *testing.T, ht *harnessTest, cfg tapdConfig,
283287
finalCfg.Universe.SyncInterval = *opts.fedSyncTickerInterval
284288
}
285289

290+
if !opts.disableSyncCache {
291+
finalCfg.Universe.MultiverseCaches.SyncerCacheEnabled = true
292+
}
293+
286294
return &tapdHarness{
287295
cfg: &cfg,
288296
clientCfg: finalCfg,

itest/test_harness.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,9 @@ type tapdHarnessParams struct {
378378
// sqliteDatabaseFilePath is the path to the SQLite database file to
379379
// use.
380380
sqliteDatabaseFilePath *string
381+
382+
// disableSyncCache indicates whether the sync cache should be disabled.
383+
disableSyncCache bool
381384
}
382385

383386
type Option func(*tapdHarnessParams)
@@ -413,6 +416,7 @@ func setupTapdHarness(t *testing.T, ht *harnessTest,
413416
ho.addrAssetSyncerDisable = params.addrAssetSyncerDisable
414417
ho.fedSyncTickerInterval = params.fedSyncTickerInterval
415418
ho.sqliteDatabaseFilePath = params.sqliteDatabaseFilePath
419+
ho.disableSyncCache = params.disableSyncCache
416420
}
417421

418422
tapdCfg := tapdConfig{

tapdb/multiverse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ func (b *MultiverseStore) UpsertProofLeaf(ctx context.Context,
786786
b.syncerCache.addOrReplace(universe.Root{
787787
ID: id,
788788
AssetName: leaf.Asset.Tag,
789-
Node: issuanceProof.MultiverseRoot,
789+
Node: issuanceProof.UniverseRoot,
790790
})
791791

792792
// Notify subscribers about the new proof leaf, now that we're sure we

0 commit comments

Comments
 (0)