mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-25 12:57:17 +00:00
Added support to NewJsonRpc to return an error as well as an interface
Also changed default port to 8080. Fixes #18
This commit is contained in:
parent
3647cc5b07
commit
a9d5656a46
@ -48,15 +48,15 @@ func (s *JsonRpcServer) Start() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewJsonRpcServer(ethp *ethpub.PEthereum) *JsonRpcServer {
|
func NewJsonRpcServer(ethp *ethpub.PEthereum) (*JsonRpcServer, error) {
|
||||||
l, err := net.Listen("tcp", ":30304")
|
l, err := net.Listen("tcp", ":8080")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ethutil.Config.Log.Infoln("Error starting JSON-RPC")
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &JsonRpcServer{
|
return &JsonRpcServer{
|
||||||
listener: l,
|
listener: l,
|
||||||
quit: make(chan bool),
|
quit: make(chan bool),
|
||||||
ethp: ethp,
|
ethp: ethp,
|
||||||
}
|
}, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user