Skip to content

Commit

Permalink
Verify invoice amount in lightning address withdrawal
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman authored Sep 19, 2023
1 parent 0eb28ef commit c7f78ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/resolvers/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ export default {
throw new Error('description hash does not match')
}

if (decoded.num_msat !== milliamount) {
throw new Err('invoice has incorrect amount')
}

// take pr and createWithdrawl
return await createWithdrawal(parent, { invoice: res2.pr, maxFee }, { me, models, lnd })
},
Expand Down

0 comments on commit c7f78ec

Please sign in to comment.