aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-15 23:44:25 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-15 23:44:25 +0800
commitf2a2164184a9397d8e6100c370595ccdcd00ca0b (patch)
treebe5f43c0255c6351b2c1b9a6db191318974fe664 /eth/backend.go
parentf475a013264b5036dfe9fcc04e21c4112845b9a2 (diff)
parent1e3f4877c0e9ebf58ffa06b0b119fdf3bab21658 (diff)
downloadgo-tangerine-f2a2164184a9397d8e6100c370595ccdcd00ca0b.tar
go-tangerine-f2a2164184a9397d8e6100c370595ccdcd00ca0b.tar.gz
go-tangerine-f2a2164184a9397d8e6100c370595ccdcd00ca0b.tar.bz2
go-tangerine-f2a2164184a9397d8e6100c370595ccdcd00ca0b.tar.lz
go-tangerine-f2a2164184a9397d8e6100c370595ccdcd00ca0b.tar.xz
go-tangerine-f2a2164184a9397d8e6100c370595ccdcd00ca0b.tar.zst
go-tangerine-f2a2164184a9397d8e6100c370595ccdcd00ca0b.zip
Merge pull request #990 from zsfelfoldi/gasprice
eth: add GasPriceOracle
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go52
1 files changed, 36 insertions, 16 deletions
diff --git a/eth/backend.go b/eth/backend.go
index 4ebf21811..17447751d 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -93,6 +93,13 @@ type Config struct {
AccountManager *accounts.Manager
SolcPath string
+ GpoMinGasPrice *big.Int
+ GpoMaxGasPrice *big.Int
+ GpoFullBlockRatio int
+ GpobaseStepDown int
+ GpobaseStepUp int
+ GpobaseCorrectionFactor int
+
// NewDB is used to create databases.
// If nil, the default is to create leveldb databases on disk.
NewDB func(path string) (common.Database, error)
@@ -196,6 +203,13 @@ type Ethereum struct {
SolcPath string
solc *compiler.Solidity
+ GpoMinGasPrice *big.Int
+ GpoMaxGasPrice *big.Int
+ GpoFullBlockRatio int
+ GpobaseStepDown int
+ GpobaseStepUp int
+ GpobaseCorrectionFactor int
+
net *p2p.Server
eventMux *event.TypeMux
miner *miner.Miner
@@ -265,22 +279,28 @@ func New(config *Config) (*Ethereum, error) {
glog.V(logger.Info).Infof("Blockchain DB Version: %d", config.BlockChainVersion)
eth := &Ethereum{
- shutdownChan: make(chan bool),
- databasesClosed: make(chan bool),
- blockDb: blockDb,
- stateDb: stateDb,
- extraDb: extraDb,
- eventMux: &event.TypeMux{},
- accountManager: config.AccountManager,
- DataDir: config.DataDir,
- etherbase: common.HexToAddress(config.Etherbase),
- clientVersion: config.Name, // TODO should separate from Name
- ethVersionId: config.ProtocolVersion,
- netVersionId: config.NetworkId,
- NatSpec: config.NatSpec,
- MinerThreads: config.MinerThreads,
- SolcPath: config.SolcPath,
- AutoDAG: config.AutoDAG,
+ shutdownChan: make(chan bool),
+ databasesClosed: make(chan bool),
+ blockDb: blockDb,
+ stateDb: stateDb,
+ extraDb: extraDb,
+ eventMux: &event.TypeMux{},
+ accountManager: config.AccountManager,
+ DataDir: config.DataDir,
+ etherbase: common.HexToAddress(config.Etherbase),
+ clientVersion: config.Name, // TODO should separate from Name
+ ethVersionId: config.ProtocolVersion,
+ netVersionId: config.NetworkId,
+ NatSpec: config.NatSpec,
+ MinerThreads: config.MinerThreads,
+ SolcPath: config.SolcPath,
+ AutoDAG: config.AutoDAG,
+ GpoMinGasPrice: config.GpoMinGasPrice,
+ GpoMaxGasPrice: config.GpoMaxGasPrice,
+ GpoFullBlockRatio: config.GpoFullBlockRatio,
+ GpobaseStepDown: config.GpobaseStepDown,
+ GpobaseStepUp: config.GpobaseStepUp,
+ GpobaseCorrectionFactor: config.GpobaseCorrectionFactor,
}
eth.pow = ethash.New()