Verify invoice amount in lightning address withdrawal (#501)

* Verify invoice amount in lightning address withdrawal

* Add benthecarman to contributors.txt
This commit is contained in:
benthecarman 2023-09-23 20:21:40 -05:00 committed by GitHub
parent dde82e25a5
commit a14341c742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -336,6 +336,9 @@ export default {
throw new Error('description hash does not match') 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 // take pr and createWithdrawl
return await createWithdrawal(parent, { invoice: res2.pr, maxFee }, { me, models, lnd }) return await createWithdrawal(parent, { invoice: res2.pr, maxFee }, { me, models, lnd })
}, },

View File

@ -3,4 +3,5 @@ kr
ekzyis ekzyis
WeAreAllSatoshi WeAreAllSatoshi
rleed rleed
bitcoinplebdev bitcoinplebdev
benthecarman