up
This commit is contained in:
parent
39b70c7b42
commit
655d3a9373
1 changed files with 3 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ export class LiquidityProvider {
|
||||||
invoicePaidCb: InvoicePaidCb
|
invoicePaidCb: InvoicePaidCb
|
||||||
connecting = false
|
connecting = false
|
||||||
readyInterval: NodeJS.Timeout
|
readyInterval: NodeJS.Timeout
|
||||||
queue: { res: (usable: boolean) => void }[] = []
|
queue: ((usable: boolean) => void)[] = []
|
||||||
// make the sub process accept client
|
// make the sub process accept client
|
||||||
constructor(pubDestination: string, invoicePaidCb: InvoicePaidCb) {
|
constructor(pubDestination: string, invoicePaidCb: InvoicePaidCb) {
|
||||||
if (!pubDestination) {
|
if (!pubDestination) {
|
||||||
|
|
@ -55,7 +55,7 @@ export class LiquidityProvider {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return new Promise<boolean>(res => {
|
return new Promise<boolean>(res => {
|
||||||
this.queue.push({ res })
|
this.queue.push(res)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,7 +70,7 @@ export class LiquidityProvider {
|
||||||
if (this.latestMaxWithdrawable === null) {
|
if (this.latestMaxWithdrawable === null) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.queue.forEach(q => q.res(true))
|
this.queue.forEach(q => q(true))
|
||||||
this.log("subbing to user operations")
|
this.log("subbing to user operations")
|
||||||
this.client.GetLiveUserOperations(res => {
|
this.client.GetLiveUserOperations(res => {
|
||||||
console.log("got user operation", res)
|
console.log("got user operation", res)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue