mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
got rid of the automatic usage of net api (#3952)
* got rid of the automatic usage of net api * less confusing comment * ops * ops2 * important * ops
This commit is contained in:
parent
230a21cfff
commit
e2fec2a081
@ -288,6 +288,7 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger,
|
|||||||
}
|
}
|
||||||
log.Info("if you run RPCDaemon on same machine with Erigon add --datadir option")
|
log.Info("if you run RPCDaemon on same machine with Erigon add --datadir option")
|
||||||
}
|
}
|
||||||
|
|
||||||
if db != nil {
|
if db != nil {
|
||||||
var cc *params.ChainConfig
|
var cc *params.ChainConfig
|
||||||
if err := db.View(context.Background(), func(tx kv.Tx) error {
|
if err := db.View(context.Background(), func(tx kv.Tx) error {
|
||||||
@ -313,11 +314,10 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger,
|
|||||||
cfg.Snapshot = ethconfig.NewSnapshotCfg(cfg.Snapshot.Enabled, cfg.Snapshot.KeepBlocks)
|
cfg.Snapshot = ethconfig.NewSnapshotCfg(cfg.Snapshot.Enabled, cfg.Snapshot.KeepBlocks)
|
||||||
}
|
}
|
||||||
|
|
||||||
// if chain config has terminal total difficulty then rpc has to have these API's to function
|
// if chain config has terminal total difficulty then rpc must have eth and engine APIs enableds
|
||||||
if cc.TerminalTotalDifficulty != nil {
|
if cc.TerminalTotalDifficulty != nil {
|
||||||
hasEthApiEnabled := false
|
hasEthApiEnabled := false
|
||||||
hasEngineApiEnabled := false
|
hasEngineApiEnabled := false
|
||||||
hasNetApiEnabled := false
|
|
||||||
|
|
||||||
for _, api := range cfg.API {
|
for _, api := range cfg.API {
|
||||||
switch api {
|
switch api {
|
||||||
@ -325,8 +325,6 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger,
|
|||||||
hasEthApiEnabled = true
|
hasEthApiEnabled = true
|
||||||
case "engine":
|
case "engine":
|
||||||
hasEngineApiEnabled = true
|
hasEngineApiEnabled = true
|
||||||
case "net":
|
|
||||||
hasNetApiEnabled = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,11 +335,6 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger,
|
|||||||
if !hasEngineApiEnabled {
|
if !hasEngineApiEnabled {
|
||||||
cfg.API = append(cfg.API, "engine")
|
cfg.API = append(cfg.API, "engine")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !hasNetApiEnabled {
|
|
||||||
cfg.API = append(cfg.API, "net")
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user