forked from btcsuite/btcd
-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
ltcd/rpcclient/infrastructure.go
Lines 1619 to 1640 in 64dfa40
| // litecoind nodes as of v0.16.0, so we'll assume the client is connected | |
| // to a ltcd backend if it does exist. | |
| info, err := c.GetInfo() | |
| switch err := err.(type) { | |
| // Parse the ltcd version and cache it. | |
| case nil: | |
| log.Debugf("Detected ltcd version: %v", info.Version) | |
| version := Btcd | |
| c.backendVersion = &version | |
| return *c.backendVersion, nil | |
| // Inspect the RPC error to ensure the method was not found, otherwise | |
| // we actually ran into an error. | |
| case *btcjson.RPCError: | |
| if err.Code != btcjson.ErrRPCMethodNotFound.Code { | |
| return 0, fmt.Errorf("unable to detect ltcd version: "+ | |
| "%v", err) | |
| } | |
| default: | |
| return 0, fmt.Errorf("unable to detect ltcd version: %v", err) |
Some node providers, such as getblock.io, return a 403 Forbidden for the getinfo API. As a result, it is unable to send transactions due to the inability to use the getinfo API. Is it better to skip the error on this API call?
Metadata
Metadata
Assignees
Labels
No labels