Browse Source

eth++ now respects gas price CLI arguments

cl-refactor
Lefteris Karapetsas 9 years ago
parent
commit
ebccf607d1
  1. 2
      libethereum/Client.h
  2. 1
      libethereum/ClientBase.h
  3. 2
      libethereum/Interface.h
  4. 2
      libweb3jsonrpc/WebThreeStubServerBase.cpp

2
libethereum/Client.h

@ -98,6 +98,8 @@ public:
/// Get the remaining gas limit in this block. /// Get the remaining gas limit in this block.
virtual u256 gasLimitRemaining() const override { return m_postMine.gasLimitRemaining(); } virtual u256 gasLimitRemaining() const override { return m_postMine.gasLimitRemaining(); }
/// Get the gas bid price
virtual u256 gasBidPrice() const override { return m_gp->bid(); }
// [PRIVATE API - only relevant for base clients, not available in general] // [PRIVATE API - only relevant for base clients, not available in general]
/// Get the block. /// Get the block.

1
libethereum/ClientBase.h

@ -148,6 +148,7 @@ public:
using Interface::addresses; using Interface::addresses;
virtual Addresses addresses(BlockNumber _block) const override; virtual Addresses addresses(BlockNumber _block) const override;
virtual u256 gasLimitRemaining() const override; virtual u256 gasLimitRemaining() const override;
virtual u256 gasBidPrice() const override { return c_defaultGasPrice; }
/// Get the coinbase address /// Get the coinbase address
virtual Address address() const override; virtual Address address() const override;

2
libethereum/Interface.h

@ -190,6 +190,8 @@ public:
/// Get the remaining gas limit in this block. /// Get the remaining gas limit in this block.
virtual u256 gasLimitRemaining() const = 0; virtual u256 gasLimitRemaining() const = 0;
// Get the gas bidding price
virtual u256 gasBidPrice() const = 0;
// [MINING API]: // [MINING API]:

2
libweb3jsonrpc/WebThreeStubServerBase.cpp

@ -244,7 +244,7 @@ void WebThreeStubServerBase::setTransactionDefaults(TransactionSkeleton & _t)
if (!_t.from) if (!_t.from)
_t.from = m_ethAccounts->defaultTransactAccount(); _t.from = m_ethAccounts->defaultTransactAccount();
if (_t.gasPrice == UndefinedU256) if (_t.gasPrice == UndefinedU256)
_t.gasPrice = c_defaultGasPrice; _t.gasPrice = client()->gasBidPrice();
if (_t.gas == UndefinedU256) if (_t.gas == UndefinedU256)
_t.gas = min<u256>(client()->gasLimitRemaining() / 5, client()->balanceAt(_t.from) / _t.gasPrice); _t.gas = min<u256>(client()->gasLimitRemaining() / 5, client()->balanceAt(_t.from) / _t.gasPrice);
} }

Loading…
Cancel
Save