reject 0 amount withdrawals

This commit is contained in:
keyan 2021-08-12 18:25:19 -05:00
parent 1d6e301b10
commit ed6a683b79

View File

@ -101,6 +101,11 @@ export default {
throw new UserInputError('could not decode invoice') throw new UserInputError('could not decode invoice')
} }
// TODO: test
if (!decoded.mtokens || Number(decoded.mtokens) <= 0) {
throw new UserInputError('you must specify amount')
}
const msatsFee = Number(maxFee) * 1000 const msatsFee = Number(maxFee) * 1000
// create withdrawl transactionally (id, bolt11, amount, fee) // create withdrawl transactionally (id, bolt11, amount, fee)