rm debug logs
This commit is contained in:
parent
ddafc2db2a
commit
4a7e4660e7
1 changed files with 1 additions and 17 deletions
|
|
@ -57,14 +57,10 @@ export class LiquidityProvider {
|
||||||
}, this.clientSend, this.clientSub)
|
}, this.clientSend, this.clientSub)
|
||||||
|
|
||||||
this.utils.nostrSender.OnReady(() => {
|
this.utils.nostrSender.OnReady(() => {
|
||||||
this.log("nostrSender is ready, checking if liquidity provider can be configured")
|
|
||||||
this.setSetIfConfigured()
|
this.setSetIfConfigured()
|
||||||
if (this.configured) {
|
if (this.configured) {
|
||||||
this.log("liquidity provider configured, clearing interval and connecting")
|
|
||||||
clearInterval(this.configuredInterval)
|
clearInterval(this.configuredInterval)
|
||||||
this.Connect()
|
this.Connect()
|
||||||
} else {
|
|
||||||
this.log("liquidity provider not yet configured, waiting for nostr info")
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.configuredInterval = setInterval(() => {
|
this.configuredInterval = setInterval(() => {
|
||||||
|
|
@ -72,7 +68,6 @@ export class LiquidityProvider {
|
||||||
this.setSetIfConfigured()
|
this.setSetIfConfigured()
|
||||||
}
|
}
|
||||||
if (this.configured) {
|
if (this.configured) {
|
||||||
this.log("liquidity provider configured via interval, clearing interval and connecting")
|
|
||||||
clearInterval(this.configuredInterval)
|
clearInterval(this.configuredInterval)
|
||||||
this.Connect()
|
this.Connect()
|
||||||
}
|
}
|
||||||
|
|
@ -316,7 +311,6 @@ export class LiquidityProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
setNostrInfo = ({ localId, localPubkey }: { localPubkey: string, localId: string }) => {
|
setNostrInfo = ({ localId, localPubkey }: { localPubkey: string, localId: string }) => {
|
||||||
this.log("setting nostr info")
|
|
||||||
this.localId = localId
|
this.localId = localId
|
||||||
this.localPubkey = localPubkey
|
this.localPubkey = localPubkey
|
||||||
this.setSetIfConfigured()
|
this.setSetIfConfigured()
|
||||||
|
|
@ -328,22 +322,13 @@ export class LiquidityProvider {
|
||||||
|
|
||||||
|
|
||||||
setSetIfConfigured = () => {
|
setSetIfConfigured = () => {
|
||||||
const nostrReady = this.utils.nostrSender.IsReady()
|
if (this.utils.nostrSender.IsReady() && !!this.providerPubkey && !!this.localId && !!this.localPubkey) {
|
||||||
const hasProviderPub = !!this.providerPubkey
|
|
||||||
const hasLocalId = !!this.localId
|
|
||||||
const hasLocalPubkey = !!this.localPubkey
|
|
||||||
|
|
||||||
if (nostrReady && hasProviderPub && hasLocalId && hasLocalPubkey) {
|
|
||||||
if (!this.configured) {
|
if (!this.configured) {
|
||||||
this.configured = true
|
this.configured = true
|
||||||
this.log("configured to send to provider")
|
|
||||||
}
|
}
|
||||||
} else if (!this.configured) {
|
|
||||||
this.log(`not configured yet: nostrReady=${nostrReady}, hasProviderPub=${hasProviderPub}, hasLocalId=${hasLocalId}, hasLocalPubkey=${hasLocalPubkey}`)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onBeaconEvent = async (beaconData: { content: string, pub: string }) => {
|
onBeaconEvent = async (beaconData: { content: string, pub: string }) => {
|
||||||
this.log("received beacon event from", beaconData.pub, "expected", this.providerPubkey)
|
|
||||||
if (beaconData.pub !== this.providerPubkey) {
|
if (beaconData.pub !== this.providerPubkey) {
|
||||||
this.log(ERROR, "got beacon from invalid pub", beaconData.pub, this.providerPubkey)
|
this.log(ERROR, "got beacon from invalid pub", beaconData.pub, this.providerPubkey)
|
||||||
return
|
return
|
||||||
|
|
@ -358,7 +343,6 @@ export class LiquidityProvider {
|
||||||
this.log(ERROR, "got beacon from invalid type", beacon.type)
|
this.log(ERROR, "got beacon from invalid type", beacon.type)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.log("valid beacon received, updating ready state")
|
|
||||||
this.lastSeenBeacon = Date.now()
|
this.lastSeenBeacon = Date.now()
|
||||||
this.ready = true
|
this.ready = true
|
||||||
if (beacon.fees) {
|
if (beacon.fees) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue