From cc3aec606dfbaee80161c2f39bc5fe86fcdba03e Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 7 Aug 2015 09:24:50 +0200 Subject: [PATCH 1/3] set 50 shannon as default gasPrice --- alethzero/MainWin.cpp | 4 ++-- eth/main.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 35752680e..2451c1a64 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -860,8 +860,8 @@ void Main::readSettings(bool _skipGeometry) p->readSettings(s); }); - static_cast(ethereum()->gasPricer().get())->setAsk(u256(s.value("askPrice", "500000000000").toString().toStdString())); - static_cast(ethereum()->gasPricer().get())->setBid(u256(s.value("bidPrice", "500000000000").toString().toStdString())); + static_cast(ethereum()->gasPricer().get())->setAsk(u256(s.value("askPrice", "50000000000").toString().toStdString())); + static_cast(ethereum()->gasPricer().get())->setBid(u256(s.value("bidPrice", "50000000000").toString().toStdString())); ui->upnp->setChecked(s.value("upnp", true).toBool()); ui->forcePublicIP->setText(s.value("forceAddress", "").toString()); diff --git a/eth/main.cpp b/eth/main.cpp index 021a3c462..3d193b9be 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -153,8 +153,8 @@ void help() /*<< " -B,--block-fees Set the block fee profit in the reference unit e.g. ¢ (default: 15)." << endl << " -e,--ether-price Set the ether price in the reference unit e.g. ¢ (default: 30.679)." << endl << " -P,--priority <0 - 100> Default % priority of a transaction (default: 50)." << endl*/ - << " --ask Set the minimum ask gas price under which no transactions will be mined (default 500000000000)." << endl - << " --bid Set the bid gas price for to pay for transactions (default 500000000000)." << endl + << " --ask Set the minimum ask gas price under which no transactions will be mined (default 50000000000)." << endl + << " --bid Set the bid gas price for to pay for transactions (default 50000000000)." << endl << endl << "Client mining:" << endl << " -a,--address Set the coinbase (mining payout) address to addr (default: auto)." << endl @@ -373,8 +373,8 @@ int main(int argc, char** argv) TransactionPriority priority = TransactionPriority::Medium; // double etherPrice = 30.679; // double blockFees = 15.0; - u256 askPrice("500000000000"); - u256 bidPrice("500000000000"); + u256 askPrice = c_defaultGasPrice; + u256 bidPrice = c_defaultGasPrice; // javascript console bool useConsole = false; From 73a40ec96ffc30132bab18b9491a26b4c0a98c4a Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 7 Aug 2015 10:48:02 +0200 Subject: [PATCH 2/3] avoid using hard coded constants --- alethzero/MainWin.cpp | 5 ++--- eth/main.cpp | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 2451c1a64..a98ba6578 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -859,9 +859,8 @@ void Main::readSettings(bool _skipGeometry) { p->readSettings(s); }); - - static_cast(ethereum()->gasPricer().get())->setAsk(u256(s.value("askPrice", "50000000000").toString().toStdString())); - static_cast(ethereum()->gasPricer().get())->setBid(u256(s.value("bidPrice", "50000000000").toString().toStdString())); + static_cast(ethereum()->gasPricer().get())->setAsk(u256(s.value("askPrice", QString::fromStdString(boost::lexical_cast(c_defaultGasPrice))).toString().toStdString())); + static_cast(ethereum()->gasPricer().get())->setBid(u256(s.value("bidPrice", QString::fromStdString(boost::lexical_cast(c_defaultGasPrice))).toString().toStdString())); ui->upnp->setChecked(s.value("upnp", true).toBool()); ui->forcePublicIP->setText(s.value("forceAddress", "").toString()); diff --git a/eth/main.cpp b/eth/main.cpp index 3d193b9be..865f8caa7 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -153,8 +153,8 @@ void help() /*<< " -B,--block-fees Set the block fee profit in the reference unit e.g. ¢ (default: 15)." << endl << " -e,--ether-price Set the ether price in the reference unit e.g. ¢ (default: 30.679)." << endl << " -P,--priority <0 - 100> Default % priority of a transaction (default: 50)." << endl*/ - << " --ask Set the minimum ask gas price under which no transactions will be mined (default 50000000000)." << endl - << " --bid Set the bid gas price for to pay for transactions (default 50000000000)." << endl + << " --ask Set the minimum ask gas price under which no transactions will be mined (default " << boost::lexical_cast(c_defaultGasPrice) << " )." << endl + << " --bid Set the bid gas price for to pay for transactions (default " << boost::lexical_cast(c_defaultGasPrice) << " )." << endl << endl << "Client mining:" << endl << " -a,--address Set the coinbase (mining payout) address to addr (default: auto)." << endl From 46b706a6ef9d8b2e90fd72cddeba2ce36610c54f Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 7 Aug 2015 12:47:08 +0200 Subject: [PATCH 3/3] replace boost::lexical_cast with toString --- alethzero/MainWin.cpp | 4 ++-- eth/main.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index a98ba6578..c606a1d20 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -859,8 +859,8 @@ void Main::readSettings(bool _skipGeometry) { p->readSettings(s); }); - static_cast(ethereum()->gasPricer().get())->setAsk(u256(s.value("askPrice", QString::fromStdString(boost::lexical_cast(c_defaultGasPrice))).toString().toStdString())); - static_cast(ethereum()->gasPricer().get())->setBid(u256(s.value("bidPrice", QString::fromStdString(boost::lexical_cast(c_defaultGasPrice))).toString().toStdString())); + static_cast(ethereum()->gasPricer().get())->setAsk(u256(s.value("askPrice", QString::fromStdString(toString(c_defaultGasPrice))).toString().toStdString())); + static_cast(ethereum()->gasPricer().get())->setBid(u256(s.value("bidPrice", QString::fromStdString(toString(c_defaultGasPrice))).toString().toStdString())); ui->upnp->setChecked(s.value("upnp", true).toBool()); ui->forcePublicIP->setText(s.value("forceAddress", "").toString()); diff --git a/eth/main.cpp b/eth/main.cpp index 865f8caa7..4057e9303 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -153,8 +153,8 @@ void help() /*<< " -B,--block-fees Set the block fee profit in the reference unit e.g. ¢ (default: 15)." << endl << " -e,--ether-price Set the ether price in the reference unit e.g. ¢ (default: 30.679)." << endl << " -P,--priority <0 - 100> Default % priority of a transaction (default: 50)." << endl*/ - << " --ask Set the minimum ask gas price under which no transactions will be mined (default " << boost::lexical_cast(c_defaultGasPrice) << " )." << endl - << " --bid Set the bid gas price for to pay for transactions (default " << boost::lexical_cast(c_defaultGasPrice) << " )." << endl + << " --ask Set the minimum ask gas price under which no transactions will be mined (default " << toString(c_defaultGasPrice) << " )." << endl + << " --bid Set the bid gas price for to pay for transactions (default " << toString(c_defaultGasPrice) << " )." << endl << endl << "Client mining:" << endl << " -a,--address Set the coinbase (mining payout) address to addr (default: auto)." << endl