Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
fix #1359
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Zeug committed Mar 31, 2017
1 parent d4eb221 commit 1cb0f5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/ipc/methods/eth_sendTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ module.exports = class extends BaseProcessor {
try {
_.each(payload.params[0], (val, key) => {
// if doesn't have hex then leave
if (_.isString(val)) {
if (_.isString(val) || _.isNumber(val)) {

// make sure all data is lowercase and has 0x
if (val) val = `0x${val.toLowerCase().replace('0x', '')}`;

if (val.match(/[^0-9a-fx]/igm)) {
throw this.ERRORS.INVALID_PAYLOAD;
}
} else {
throw this.ERRORS.INVALID_PAYLOAD;
}

payload.params[0][key] = val;
Expand Down

0 comments on commit 1cb0f5c

Please sign in to comment.