diff options
Diffstat (limited to 'eth')
-rw-r--r-- | eth/api.go | 4 | ||||
-rw-r--r-- | eth/backend.go | 4 | ||||
-rw-r--r-- | eth/config.go | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/eth/api.go b/eth/api.go index 61f7bdd92..88b3dbbf9 100644 --- a/eth/api.go +++ b/eth/api.go @@ -153,6 +153,8 @@ func (api *PrivateMinerAPI) Start(threads *int) error { } // Start the miner and return if !api.e.IsMining() { + // Propagate the initial price point to the transaction pool + api.e.txPool.SetGasPrice(api.e.gasPrice) return api.e.StartMining(true) } return nil @@ -180,7 +182,7 @@ func (api *PrivateMinerAPI) SetExtra(extra string) (bool, error) { // SetGasPrice sets the minimum accepted gas price for the miner. func (api *PrivateMinerAPI) SetGasPrice(gasPrice hexutil.Big) bool { - api.e.Miner().SetGasPrice((*big.Int)(&gasPrice)) + api.e.txPool.SetGasPrice((*big.Int)(&gasPrice)) return true } diff --git a/eth/backend.go b/eth/backend.go index f864b1d88..7c63fa51d 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -20,6 +20,7 @@ package eth import ( "errors" "fmt" + "math/big" "runtime" "sync" "sync/atomic" @@ -76,6 +77,7 @@ type Ethereum struct { ApiBackend *EthApiBackend miner *miner.Miner + gasPrice *big.Int Mining bool MinerThreads int etherbase common.Address @@ -167,7 +169,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { } eth.miner = miner.New(eth, eth.chainConfig, eth.EventMux(), eth.engine) - eth.miner.SetGasPrice(config.GasPrice) + eth.gasPrice = config.GasPrice eth.miner.SetExtra(makeExtraData(config.ExtraData)) eth.ApiBackend = &EthApiBackend{eth, nil} diff --git a/eth/config.go b/eth/config.go index a09ca76f3..22c09b170 100644 --- a/eth/config.go +++ b/eth/config.go @@ -42,7 +42,7 @@ var DefaultConfig = Config{ NetworkId: 1, LightPeers: 20, DatabaseCache: 128, - GasPrice: big.NewInt(20 * params.Shannon), + GasPrice: big.NewInt(18 * params.Shannon), GPO: gasprice.Config{ Blocks: 10, |