Skip to content

Commit

Permalink
Verify invoice amount in lightning address withdrawal (#501)
Browse files Browse the repository at this point in the history
* Verify invoice amount in lightning address withdrawal

* Add benthecarman to contributors.txt
  • Loading branch information
benthecarman committed Sep 24, 2023
1 parent dde82e2 commit a14341c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions api/resolvers/wallet.js
Expand Up @@ -336,6 +336,9 @@ export default {
throw new Error('description hash does not match')
}

if (!decoded.mtokens || BigInt(decoded.mtokens) !== BigInt(milliamount)) {
throw new Error('invoice has incorrect amount')
}
// take pr and createWithdrawl
return await createWithdrawal(parent, { invoice: res2.pr, maxFee }, { me, models, lnd })
},
Expand Down
3 changes: 2 additions & 1 deletion contributors.txt
Expand Up @@ -3,4 +3,5 @@ kr
ekzyis
WeAreAllSatoshi
rleed
bitcoinplebdev
bitcoinplebdev
benthecarman

0 comments on commit a14341c

Please sign in to comment.