deb
This commit is contained in:
parent
98d8561963
commit
1e27823ce9
2 changed files with 3 additions and 0 deletions
|
|
@ -119,6 +119,7 @@ export default class {
|
||||||
const balanceEvents = await this.paymentManager.GetLndBalance()
|
const balanceEvents = await this.paymentManager.GetLndBalance()
|
||||||
await this.metricsManager.NewBlockCb(height, balanceEvents)
|
await this.metricsManager.NewBlockCb(height, balanceEvents)
|
||||||
confirmed = await this.paymentManager.CheckNewlyConfirmedTxs(height)
|
confirmed = await this.paymentManager.CheckNewlyConfirmedTxs(height)
|
||||||
|
log("checked newly confirmed transactions", confirmed)
|
||||||
await this.liquidityManager.onNewBlock()
|
await this.liquidityManager.onNewBlock()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
log(ERROR, "failed to check transactions after new block", err.message || err)
|
log(ERROR, "failed to check transactions after new block", err.message || err)
|
||||||
|
|
|
||||||
|
|
@ -211,9 +211,11 @@ export default class {
|
||||||
}
|
}
|
||||||
const existingAddress = await this.storage.paymentStorage.GetExistingUserAddress(ctx.user_id, app)
|
const existingAddress = await this.storage.paymentStorage.GetExistingUserAddress(ctx.user_id, app)
|
||||||
if (existingAddress) {
|
if (existingAddress) {
|
||||||
|
this.log("returning existing address", existingAddress.address)
|
||||||
return { address: existingAddress.address }
|
return { address: existingAddress.address }
|
||||||
}
|
}
|
||||||
const res = await this.lnd.NewAddress(req.addressType, { useProvider: false, from: 'user' })
|
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 })
|
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 })
|
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 }
|
return { address: userAddress.address }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue