diff options
| author | Adam Soltys <[email protected]> | 2025-03-05 12:37:37 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-03-05 12:37:37 -0800 |
| commit | b01b24f6a1007bc8a3b41d9aeb7060e7aedaac1c (patch) | |
| tree | ac799198414d28e05878443d153aacf669b75a9b /lib | |
| parent | 51c38adbc2d6ff76aafb32a9c6d8a4cab83b1736 (diff) | |
| download | coinos-server-b01b24f6a1007bc8a3b41d9aeb7060e7aedaac1c.tar.gz coinos-server-b01b24f6a1007bc8a3b41d9aeb7060e7aedaac1c.zip | |
get payment_hash if possible
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/nwc.ts | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 } = |
