Merge pull request #864 from shocknet/seed-fix

seed fix
This commit is contained in:
Justin (shocknet) 2025-12-15 15:12:49 -05:00 committed by GitHub
commit a8455b8799
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -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 }
}

View file

@ -18,7 +18,8 @@ export class LiquidityStorage {
}
async GetNoodeSeed(pubkey: string) {
return this.dbs.FindOne<LndNodeInfo>('LndNodeInfo', { where: { pubkey, seed: Not(IsNull()) } })
const node = await this.dbs.FindOne<LndNodeInfo>('LndNodeInfo', { where: { pubkey/* , seed: Not(IsNull()) */ } })
return node?.seed
}
async SaveNodeSeed(pubkey: string, seed: string) {