mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
Compensate for the inability to capture panic caused by register
This commit is contained in:
parent
ae5a16f870
commit
4ca57ab76c
1 changed files with 5 additions and 0 deletions
|
|
@ -46,6 +46,11 @@ import (
|
|||
// Register adds the engine API to the full node.
|
||||
func Register(stack *node.Node, backend *eth.Ethereum) error {
|
||||
log.Warn("Engine API enabled", "protocol", "eth")
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = fmt.Errorf("panic %v when register consensus api", r)
|
||||
}
|
||||
}()
|
||||
stack.RegisterAPIs([]rpc.API{
|
||||
{
|
||||
Namespace: "engine",
|
||||
|
|
|
|||
Loading…
Reference in a new issue