Skip to content

Commit

Permalink
Fix #1844 rpc call 'getGasPrice' is called even when tx.gasPrice is s…
Browse files Browse the repository at this point in the history
…et to 0. (#1845)

* Fix bug: Call 'getGasPrice' rpc when tx.gasPrice is set to 0 intentionally

* Compare whether the value is undefined through 'typeof' operator
  • Loading branch information
nujabes403 authored and frozeman committed Aug 7, 2018
1 parent 0ef6ee8 commit 73c1e0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web3-core-method/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ Method.prototype.buildCall = function() {
};

// Send the actual transaction
if(isSendTx && _.isObject(payload.params[0]) && !payload.params[0].gasPrice) {
if(isSendTx && _.isObject(payload.params[0]) && typeof payload.params[0].gasPrice === 'undefined') {

var getGasPrice = (new Method({
name: 'getGasPrice',
Expand Down

0 comments on commit 73c1e0d

Please sign in to comment.