aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-03-05 12:37:37 -0800
committerAdam Soltys <[email protected]>2025-03-05 12:37:37 -0800
commitb01b24f6a1007bc8a3b41d9aeb7060e7aedaac1c (patch)
treeac799198414d28e05878443d153aacf669b75a9b
parent51c38adbc2d6ff76aafb32a9c6d8a4cab83b1736 (diff)
downloadcoinos-server-b01b24f6a1007bc8a3b41d9aeb7060e7aedaac1c.tar.gz
coinos-server-b01b24f6a1007bc8a3b41d9aeb7060e7aedaac1c.zip
get payment_hash if possible
-rw-r--r--lib/nwc.ts4
1 files changed, 2 insertions, 2 deletions
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 } =