-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forbid unlocking accounts with enabled external RPC #338
Forbid unlocking accounts with enabled external RPC #338
Conversation
@@ -269,7 +270,7 @@ func newService(config Config, store *Store, blockProc BlockProc, engine lachesi | |||
} | |||
|
|||
// create API backend | |||
svc.EthAPI = &EthAPIBackend{config.ExtRPCEnabled, svc, stateReader, txSigner, config.AllowUnprotectedTxs} | |||
svc.EthAPI = &EthAPIBackend{false, svc, stateReader, txSigner, config.AllowUnprotectedTxs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems that we intend to init this with true
? otherwise, it still work like before
svc.EthAPI = &EthAPIBackend{false, svc, stateReader, txSigner, config.AllowUnprotectedTxs} | |
svc.EthAPI = &EthAPIBackend{true, svc, stateReader, txSigner, config.AllowUnprotectedTxs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's initialized by SetExtRPCEnabled later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, incompatible with previous dumped configs:
TOML config file error: field corresponding to "ExtRPCEnabled" is not defined in gossip.Config
.
@@ -39,6 +39,11 @@ type EthAPIBackend struct { | |||
allowUnprotectedTxs bool | |||
} | |||
|
|||
// SetExtRPCEnabled updates extRPCEnabled | |||
func (b *EthAPIBackend) SetExtRPCEnabled(v bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setter is not needed, just assign it directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to highlight that this variable may be initialized after object creation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
--allow-insecure-unlock
argument is added