diff options
| author | Adam Soltys <[email protected]> | 2024-09-13 12:18:04 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-09-13 12:18:04 -0700 |
| commit | 183315347b3ce6d4057abe05861c39f5d4b1aa46 (patch) | |
| tree | f8f585af47f620ace424b9418336bf8d840ea1fe /lib | |
| parent | b00fee005fc69f79d300fa71a3619d97f4571c23 (diff) | |
| download | coinos-server-183315347b3ce6d4057abe05861c39f5d4b1aa46.tar.gz coinos-server-183315347b3ce6d4057abe05861c39f5d4b1aa46.zip | |
allow intra-account sends, write wallets to conf file
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/payments.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/payments.ts b/lib/payments.ts index 5f8f3e0a..454c9753 100644 --- a/lib/payments.ts +++ b/lib/payments.ts @@ -422,7 +422,8 @@ export let sendOnchain = async (params) => { value, } of tx.vout) { total += sats(value); - if (await g(`invoice:${address}`)) + let invoice = await g(`invoice:${address}`); + if (invoice?.account === account) fail("Cannot send to internal address"); if ((await node.getAddressInfo(address)).ismine) change += sats(value); @@ -503,7 +504,7 @@ export let sendLightning = async ({ let invoice = await getInvoice(hash); if (invoice) { - if (invoice.uid === user.id) fail("Cannot send to self"); + if (invoice.account === user.id) fail("Cannot send to self"); hash = pr; } else { let r; |
