Skip to content

Commit

Permalink
Fixed a bug where the wrong default value would be set to lndNoGraphC…
Browse files Browse the repository at this point in the history
…ache

This would cause a crash on startup the next time config is written, because
it would be set to 3600 instead of 0 or 1.
  • Loading branch information
hsjoberg committed Mar 3, 2022
1 parent c92ce87 commit 74c51c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/migration/app-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,10 @@ export const appMigration: IAppMigration[] = [
await db.executeSql("ALTER TABLE tx ADD lud16IdentifierMimeType TEXT NULL");
},
},
// Version 29
{
async beforeLnd(db, i) {
setItemObject<boolean>(StorageItem.lndNoGraphCache, false);
},
},
];
2 changes: 1 addition & 1 deletion src/state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export const model: IStoreModel = {
const bitcoindRpcPass = await getItemAsyncStorage(StorageItem.bitcoindRpcPass) || null;
const bitcoindPubRawBlock = await getItemAsyncStorage(StorageItem.bitcoindPubRawBlock) || null;
const bitcoindPubRawTx = await getItemAsyncStorage(StorageItem.bitcoindPubRawTx) || null;
const lndNoGraphCache = getState().settings.lndNoGraphCache;
const lndNoGraphCache = await getItemAsyncStorage(StorageItem.lndNoGraphCache) || "0";

const nodeBackend = lndChainBackend === "neutrino" ? "neutrino" : "bitcoind";

Expand Down
2 changes: 1 addition & 1 deletion src/storage/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export const setupApp = async () => {
setItemObject<boolean>(StorageItem.requireGraphSync, false),
setItemObject<boolean>(StorageItem.dunderEnabled, false),
setItemObject<boolean>(StorageItem.lndNoGraphCache, false),
setItemObject<number>(StorageItem.lndNoGraphCache, DEFAULT_INVOICE_EXPIRY),
setItemObject<number>(StorageItem.invoiceExpiry, DEFAULT_INVOICE_EXPIRY),
setItemObject<boolean>(StorageItem.rescanWallet, false),
]);
};

1 comment on commit 74c51c0

@vercel
Copy link

@vercel vercel bot commented on 74c51c0 Mar 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.