Open ClareLau61803 opened 5 years ago
issue code: if (amount){ if (typeof amount !== 'number') throw Error('amount must be a number'); if (amount < 0) throw Error('amount must be positive'); }
Such a try should result on a validation error at this point of code:
https://github.com/byteball/ocore/blob/master/composer.js#L651
with something like Validation error: amount must be positive integer, found 996741.7
returned as error.
It's before broadcasting or writing into database so I don't understand the consequences you are talking about.
It should be appropriate though to add a check for integer directly in sendMultiPayment function.
All amounts are integer, in the smallest unit (bytes). There is no decimals.
wallet.js -sendMultiPayment(): did not check whether the amount is real. The decimal part will be lost when the data is stored into database. Verification failed when other nodes(like headless) synchronize unit and verify.