Fix human amount detection in .payment

This commit is contained in:
wltsmrz
2013-09-11 13:00:32 -07:00
parent 56a8ad3aa5
commit 2463fd9588

View File

@@ -517,7 +517,7 @@ Transaction.prototype.payment = function (src, dst, amount) {
throw new Error('Payment destination address invalid');
}
if (typeof amount === 'string' && !Number(amount)) {
if (/^[\d]+[A-Z]{3}$/.test(amount)) {
amount = Amount.from_human(amount);
}