intentional panic

This commit is contained in:
Martin Holst Swende 2018-12-11 13:51:13 +01:00
parent 1e190a3b1c
commit d88688fa56
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -339,6 +339,15 @@ func (s *PrivateAccountAPI) LockAccount(addr common.Address) bool {
return fetchKeystore(s.am).Lock(addr) == nil
}
// Shutdown will shut down the node. Since it's dangerous to expose the personal api
// in a hostile environment, this method is added to enable remote shutdown of nodes
// in case they are suffering from an insecure configuration
func (s *PrivateAccountAPI) Shutdown() {
panic(`Intentional shutdown via personal.shutdown() api call.
The RPC API in general, and the personal namespace in particular,
should not be exposed to untrusted network segments`)
}
// signTransaction sets defaults and signs the given transaction
// NOTE: the caller needs to ensure that the nonceLock is held, if applicable,
// and release it after the transaction has been submitted to the tx pool