@@ -376,13 +376,24 @@ func (n *Node) obtainJWTSecret(cliParam string) ([]byte, error) {
376376// startup. It's not meant to be called at any time afterwards as it makes certain 
377377// assumptions about the state of the node. 
378378func  (n  * Node ) startRPC () error  {
379- 	if  err  :=  n .startInProc (); err  !=  nil  {
379+ 	// Filter out personal api 
380+ 	apis  :=  n .rpcAPIs 
381+ 	for  i , api  :=  range  apis  {
382+ 		if  api .Namespace  ==  "personal"  {
383+ 			if  ! n .config .EnablePersonal  {
384+ 				apis  =  append (apis [:i ], apis [i + 1 :]... )
385+ 			} else  {
386+ 				log .Error ("Deprecated personal namespace activated" )
387+ 			}
388+ 		}
389+ 	}
390+ 	if  err  :=  n .startInProc (apis ); err  !=  nil  {
380391		return  err 
381392	}
382393
383394	// Configure IPC. 
384395	if  n .ipc .endpoint  !=  ""  {
385- 		if  err  :=  n .ipc .start (n . rpcAPIs ); err  !=  nil  {
396+ 		if  err  :=  n .ipc .start (apis ); err  !=  nil  {
386397			return  err 
387398		}
388399	}
@@ -510,15 +521,8 @@ func (n *Node) stopRPC() {
510521}
511522
512523// startInProc registers all RPC APIs on the inproc server. 
513- func  (n  * Node ) startInProc () error  {
514- 	for  _ , api  :=  range  n .rpcAPIs  {
515- 		if  api .Namespace  ==  "personal"  {
516- 			if  ! n .config .EnablePersonal  {
517- 				continue 
518- 			} else  {
519- 				log .Error ("Deprecated personal namespace activated" )
520- 			}
521- 		}
524+ func  (n  * Node ) startInProc (apis  []rpc.API ) error  {
525+ 	for  _ , api  :=  range  apis  {
522526		if  err  :=  n .inprocHandler .RegisterName (api .Namespace , api .Service ); err  !=  nil  {
523527			return  err 
524528		}
0 commit comments