aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2019-04-04 19:03:10 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-04-04 19:03:10 +0800
commitd5cae48bae81cd6072255150162b26a3653f176e (patch)
treee516341d29d6fbffbac0f389ef012fb273326c8b /eth
parent9b3601cfce4d61cd303f5e243813fa89426259d4 (diff)
downloadgo-tangerine-d5cae48bae81cd6072255150162b26a3653f176e.tar
go-tangerine-d5cae48bae81cd6072255150162b26a3653f176e.tar.gz
go-tangerine-d5cae48bae81cd6072255150162b26a3653f176e.tar.bz2
go-tangerine-d5cae48bae81cd6072255150162b26a3653f176e.tar.lz
go-tangerine-d5cae48bae81cd6072255150162b26a3653f176e.tar.xz
go-tangerine-d5cae48bae81cd6072255150162b26a3653f176e.tar.zst
go-tangerine-d5cae48bae81cd6072255150162b26a3653f176e.zip
accounts, cmd, internal: disable unlock account on open HTTP (#17037)
* cmd, accounts, internal, node, rpc, signer: insecure unlock protect * all: strict unlock API by rpc * cmd/geth: check before printing warning log * accounts, cmd/geth, internal: tiny polishes
Diffstat (limited to 'eth')
-rw-r--r--eth/api_backend.go9
-rw-r--r--eth/backend.go2
2 files changed, 8 insertions, 3 deletions
diff --git a/eth/api_backend.go b/eth/api_backend.go
index 7e90f8010..29ce19e28 100644
--- a/eth/api_backend.go
+++ b/eth/api_backend.go
@@ -38,8 +38,9 @@ import (
// EthAPIBackend implements ethapi.Backend for full nodes
type EthAPIBackend struct {
- eth *Ethereum
- gpo *gasprice.Oracle
+ extRPCEnabled bool
+ eth *Ethereum
+ gpo *gasprice.Oracle
}
// ChainConfig returns the active chain configuration.
@@ -213,6 +214,10 @@ func (b *EthAPIBackend) AccountManager() *accounts.Manager {
return b.eth.AccountManager()
}
+func (b *EthAPIBackend) ExtRPCEnabled() bool {
+ return b.extRPCEnabled
+}
+
func (b *EthAPIBackend) BloomStatus() (uint64, uint64) {
sections, _, _ := b.eth.bloomIndexer.Sections()
return params.BloomBitsBlocks, sections
diff --git a/eth/backend.go b/eth/backend.go
index af963fa49..b13cb1028 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -197,7 +197,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
eth.miner = miner.New(eth, chainConfig, eth.EventMux(), eth.engine, config.MinerRecommit, config.MinerGasFloor, config.MinerGasCeil, eth.isLocalBlock)
eth.miner.SetExtra(makeExtraData(config.MinerExtraData))
- eth.APIBackend = &EthAPIBackend{eth, nil}
+ eth.APIBackend = &EthAPIBackend{ctx.ExtRPCEnabled(), eth, nil}
gpoParams := config.GPO
if gpoParams.Default == nil {
gpoParams.Default = config.MinerGasPrice