nwc debugging

This commit is contained in:
William Casarin
2023-05-24 14:56:01 -07:00
parent 1b161fefd0
commit 47a74257c8
4 changed files with 17 additions and 9 deletions

View File

@@ -150,6 +150,11 @@ class PostBox {
relayer.attempts += 1
relayer.last_attempt = Int64(Date().timeIntervalSince1970)
relayer.retry_after *= 1.5
if let relay = pool.get_relay(relayer.relay) {
print("flushing event \(event.event.id) to \(relayer.relay)")
} else {
print("could not find relay when flushing: \(relayer.relay)")
}
pool.send(.event(event.event), to: [relayer.relay], skip_ephemeral: event.skip_ephemeral)
}
}

View File

@@ -180,7 +180,7 @@ func subscribe_to_nwc(url: WalletConnectURL, pool: RelayPool) {
filter.limit = 0
let sub = NostrSubscribe(filters: [filter], sub_id: "nwc")
pool.send(.subscribe(sub), to: [url.relay.id])
pool.send(.subscribe(sub), to: [url.relay.id], skip_ephemeral: false)
}
@discardableResult
@@ -233,6 +233,7 @@ func send_donation_zap(pool: RelayPool, postbox: PostBox, nwc: WalletConnectURL,
return
}
print("damus-donation donating...")
nwc_pay(url: nwc, pool: pool, post: postbox, invoice: invoice, delay: nil)
}