diff --git a/src/services/main/unlocker.ts b/src/services/main/unlocker.ts index f129834f..2f1ade76 100644 --- a/src/services/main/unlocker.ts +++ b/src/services/main/unlocker.ts @@ -211,11 +211,10 @@ export class Unlocker { throw new Error("node pub not found") } const encrypted = await this.storage.liquidityStorage.GetNoodeSeed(this.nodePub) - if (!encrypted || !encrypted.seed) { + if (!encrypted) { throw new Error("seed not found") } - - const decrypted = this.DecryptWalletSeed(JSON.parse(encrypted.seed)) + const decrypted = this.DecryptWalletSeed(JSON.parse(encrypted)) return { seed: decrypted } } diff --git a/src/services/storage/liquidityStorage.ts b/src/services/storage/liquidityStorage.ts index 0a609ed5..74364e33 100644 --- a/src/services/storage/liquidityStorage.ts +++ b/src/services/storage/liquidityStorage.ts @@ -18,7 +18,8 @@ export class LiquidityStorage { } async GetNoodeSeed(pubkey: string) { - return this.dbs.FindOne('LndNodeInfo', { where: { pubkey, seed: Not(IsNull()) } }) + const node = await this.dbs.FindOne('LndNodeInfo', { where: { pubkey/* , seed: Not(IsNull()) */ } }) + return node?.seed } async SaveNodeSeed(pubkey: string, seed: string) {