WIP: blockchain.transaction.yyy JSON RPC implementations #78

Merged
moodyjon merged 12 commits from blockchain_tx_rpc1 into master 2022-12-06 22:14:28 +01:00
Showing only changes of commit 22a50ad085 - Show all commits

View file

@ -54,13 +54,13 @@ func (cr *gorillaRpcCodecRequest) Method() (string, error) {
func (s *Server) StartJsonRPC() error { func (s *Server) StartJsonRPC() error {
// Set up the pure JSONRPC server with persistent connections/sessions. // Set up the pure JSONRPC server with persistent connections/sessions.
if s.Args.JSONRPCPort != 0 { if s.Args.JSONRPCPort != 0 {
port := ":" + strconv.FormatUint(uint64(s.Args.JSONRPCPort), 10) port := ":" + strconv.Itoa(s.Args.JSONRPCPort)
laddr, err := net.ResolveTCPAddr("tcp", port) laddr, err := net.ResolveTCPAddr("tcp4", port)
if err != nil { if err != nil {
log.Errorf("ResoveIPAddr: %v\n", err) log.Errorf("ResoveIPAddr: %v\n", err)
goto fail1 goto fail1
} }
listener, err := net.ListenTCP("tcp", laddr) listener, err := net.ListenTCP("tcp4", laddr)
if err != nil { if err != nil {
log.Errorf("ListenTCP: %v\n", err) log.Errorf("ListenTCP: %v\n", err)
goto fail1 goto fail1