up
This commit is contained in:
parent
2dbbd6adde
commit
39b70c7b42
2 changed files with 15 additions and 9 deletions
|
|
@ -47,16 +47,16 @@ export class LiquidityProvider {
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
AwaitProviderReady = async (res: (usable: boolean) => void) => {
|
AwaitProviderReady = async (): Promise<boolean> => {
|
||||||
if (!this.pubDestination) {
|
if (!this.pubDestination) {
|
||||||
res(false)
|
return false
|
||||||
return
|
|
||||||
}
|
}
|
||||||
if (this.latestMaxWithdrawable !== null) {
|
if (this.latestMaxWithdrawable !== null) {
|
||||||
res(true)
|
return true
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
return new Promise<boolean>(res => {
|
||||||
this.queue.push({ res })
|
this.queue.push({ res })
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
Stop = () => {
|
Stop = () => {
|
||||||
|
|
|
||||||
|
|
@ -236,9 +236,15 @@ export default class SanityChecker {
|
||||||
this.events = await this.storage.eventsLog.GetAllLogs()
|
this.events = await this.storage.eventsLog.GetAllLogs()
|
||||||
this.invoices = (await this.lnd.GetAllPaidInvoices(1000)).invoices
|
this.invoices = (await this.lnd.GetAllPaidInvoices(1000)).invoices
|
||||||
this.payments = (await this.lnd.GetAllPayments(1000)).payments
|
this.payments = (await this.lnd.GetAllPayments(1000)).payments
|
||||||
|
const providerUsable = await this.lnd.liquidProvider.AwaitProviderReady()
|
||||||
|
if (providerUsable) {
|
||||||
const ops = await this.lnd.liquidProvider.GetOperations()
|
const ops = await this.lnd.liquidProvider.GetOperations()
|
||||||
this.providerInvoices = ops.latestIncomingInvoiceOperations.operations
|
this.providerInvoices = ops.latestIncomingInvoiceOperations.operations
|
||||||
this.providerPayments = ops.latestOutgoingInvoiceOperations.operations
|
this.providerPayments = ops.latestOutgoingInvoiceOperations.operations
|
||||||
|
} else {
|
||||||
|
this.log("provider not usable, skipping provider checks")
|
||||||
|
}
|
||||||
|
|
||||||
this.incrementSources = {}
|
this.incrementSources = {}
|
||||||
this.decrementSources = {}
|
this.decrementSources = {}
|
||||||
this.users = {}
|
this.users = {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue