aboutsummaryrefslogtreecommitdiffstats
path: root/lib/nwc.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-12-02 22:50:11 -0800
committerAdam Soltys <[email protected]>2024-12-02 22:50:11 -0800
commit5a8c49ad031dcb175ff4a0dec71c818eeab0b491 (patch)
tree9e78528c72256700df1b966519ec200cb8b86f05 /lib/nwc.ts
parent2484b61e149273d788170c4d64e679b5b0f8155d (diff)
downloadcoinos-server-5a8c49ad031dcb175ff4a0dec71c818eeab0b491.tar.gz
coinos-server-5a8c49ad031dcb175ff4a0dec71c818eeab0b491.zip
detect duplicate keysend
Diffstat (limited to 'lib/nwc.ts')
-rw-r--r--lib/nwc.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/nwc.ts b/lib/nwc.ts
index ef5e156e..6313e05d 100644
--- a/lib/nwc.ts
+++ b/lib/nwc.ts
@@ -56,7 +56,7 @@ export default () => {
const user = await g(`user:${uid}`);
try {
- const result = await handle(method, params, user);
+ const result = await handle(method, params, user, ev);
const payload = JSON.stringify({ result_type: method, ...result });
content = await nip04.encrypt(sk, pubkey, payload);
@@ -88,7 +88,7 @@ export default () => {
});
};
-const handle = (method, params, user) =>
+const handle = (method, params, user, ev) =>
({
async pay_invoice() {
const { invoice: pr } = params;
@@ -145,6 +145,7 @@ const handle = (method, params, user) =>
const { amount, pubkey } = params;
const { payment_hash } = await sendKeysend({
+ hash: ev.id,
amount,
pubkey,
user,