fix nil gasPrice
This commit is contained in:
parent
03b5db7053
commit
cf59e6b1eb
|
@ -359,13 +359,17 @@ function validateSend(params, context) {
|
||||||
function handleSend(params, context) {
|
function handleSend(params, context) {
|
||||||
var val = web3.toWei(params["amount"].replace(",", "."), "ether");
|
var val = web3.toWei(params["amount"].replace(",", "."), "ether");
|
||||||
|
|
||||||
|
var gasPrice = calculateGasPrice(params["bot-db"]["sliderValue"]);
|
||||||
var data = {
|
var data = {
|
||||||
from: context.from,
|
from: context.from,
|
||||||
to: params["bot-db"]["public"]["recipient"]["address"],
|
to: params["bot-db"]["public"]["recipient"]["address"],
|
||||||
value: val,
|
value: val
|
||||||
gasPrice: calculateGasPrice(params["bot-db"]["sliderValue"])
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (gasPrice) {
|
||||||
|
data.gasPrice = gasPrice;
|
||||||
|
}
|
||||||
|
|
||||||
web3.eth.sendTransaction(data, function(error, hash) {
|
web3.eth.sendTransaction(data, function(error, hash) {
|
||||||
if (error) {
|
if (error) {
|
||||||
status.sendSignal("handler-result", {
|
status.sendSignal("handler-result", {
|
||||||
|
|
Loading…
Reference in New Issue