From b01b24f6a1007bc8a3b41d9aeb7060e7aedaac1c Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 5 Mar 2025 12:37:37 -0800 Subject: get payment_hash if possible --- lib/nwc.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/nwc.ts b/lib/nwc.ts index 83477595..c9419043 100644 --- a/lib/nwc.ts +++ b/lib/nwc.ts @@ -6,10 +6,10 @@ import { err, l, warn } from "$lib/logging"; import { handleZap, serverPubkey, serverSecret } from "$lib/nostr"; import { sendInternal, sendKeysend, sendLightning } from "$lib/payments"; import { fail, getInvoice, sleep } from "$lib/utils"; +import rpc from "@coinos/rpc"; import { hexToBytes } from "@noble/hashes/utils"; import { Relay } from "nostr"; import { finalizeEvent, nip04 } from "nostr-tools"; -import rpc from "@coinos/rpc"; import type { UnsignedEvent } from "nostr-tools"; const result = (result) => ({ result }); @@ -364,7 +364,7 @@ const handle = (method, params, ev, app, user) => if (p.amount < 0 && type === "incoming") continue; if (p.amount > 0 && type === "outgoing") continue; - let payment_hash = p.id; + let payment_hash = p.payment_hash || pid; if (p.type === "lightning") { try { ({ payment_hash } = -- cgit v1.2.3