Skip to content

[bug]: rpcclient dial failed using v0.25.0 #2464

@lcmmhcc

Description

@lcmmhcc

Background

create a rpc client using code below

connCfg := &rpcclient.ConnConfig{
	Host:         fmt.Sprintf("%s%s", "https://go.getblock.io","/xxxx"), //xxxx is my secret key 
	HTTPPostMode: true,
	DisableTLS:   false,
}
api, err := rpcclient.New(connCfg, nil)
if err != nil {
	return nil, err
}

blockCount, err := api.GetBlockCount()
if err != nil {
	return 0, err
}

and that is ok in v0.24.2

but in v0.25.0, it return error:

invalid http POST response (nil), method: getblockcount, id: 1, last error=Post "https://go.getblock.io/xxxx": dial tcp 185.44.207.225:0: connect: can't assign requested address

i suppose that #2168 leads an unexpected behavior , plz help check.

Your environment

  • version of btcd : v0.25.0
  • which operating system (uname -a on *Nix) : not related
  • any other relevant environment details : not related

Steps to reproduce

using "https://go.getblock.io" as a config.Host and call GetBlockCount() or any other func()

blockCount, err := api.GetBlockCount()
if err != nil {
	return 0, err
}

Expected behaviour

return no err

Actual behaviour

but in v0.25.0, it return error:
invalid http POST response (nil), method: getrawtransaction, id: 1, last error=Post "https://go.getblock.io/xxxx": dial tcp

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions