From d88688fa56dd8d55771bef160fab724acb3b0771 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Tue, 11 Dec 2018 13:51:13 +0100 Subject: [PATCH] intentional panic --- internal/ethapi/api.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 656555b3ba..4956d41287 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -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