This commit is contained in:
boufni95 2025-04-16 17:28:06 +00:00
parent 98d8561963
commit 1e27823ce9
2 changed files with 3 additions and 0 deletions

View file

@ -119,6 +119,7 @@ export default class {
const balanceEvents = await this.paymentManager.GetLndBalance()
await this.metricsManager.NewBlockCb(height, balanceEvents)
confirmed = await this.paymentManager.CheckNewlyConfirmedTxs(height)
log("checked newly confirmed transactions", confirmed)
await this.liquidityManager.onNewBlock()
} catch (err: any) {
log(ERROR, "failed to check transactions after new block", err.message || err)

View file

@ -211,9 +211,11 @@ export default class {
}
const existingAddress = await this.storage.paymentStorage.GetExistingUserAddress(ctx.user_id, app)
if (existingAddress) {
this.log("returning existing address", existingAddress.address)
return { address: existingAddress.address }
}
const res = await this.lnd.NewAddress(req.addressType, { useProvider: false, from: 'user' })
this.log("generated new address", res.address)
const userAddress = await this.storage.paymentStorage.AddUserAddress(user, res.address, { linkedApplication: app })
this.storage.eventsLog.LogEvent({ type: 'new_address', userId: user.user_id, appUserId: "", appId: app.app_id, balance: user.balance_sats, data: res.address, amount: 0 })
return { address: userAddress.address }