HTTPClient: honor --http-timeout

This commit is contained in:
The MMGen Project 2025-06-12 12:48:50 +00:00
commit 5bc0977948
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 4 additions and 4 deletions

View file

@ -170,7 +170,7 @@ class Config(Lockable):
no_license = False
# limits
http_timeout = 60
http_timeout = 0
usr_randchars = 30
fee_adjust = 1.0
fee_estimate_confs = 3

View file

@ -47,7 +47,7 @@ class HTTPClient:
url = self.network_proto + '://' + self.host + path
kwargs = {
'url': url,
'timeout': timeout or self.timeout,
'timeout': self.cfg.http_timeout or timeout or self.timeout,
'verify': self.verify}
if data:
kwargs['data'] = data

View file

@ -301,7 +301,7 @@ class UserOpts(Opts):
Rr --daemon-id=ID Specify the coin daemon ID
rr --ignore-daemon-version Ignore coin daemon version check
Rr --list-daemon-ids List all available daemon IDs
rr --http-timeout=t Set HTTP timeout in seconds for JSON-RPC connections
-r --http-timeout=t Set HTTP timeout in seconds for JSON-RPC connections
-- --no-license Suppress the GPL license prompt
Rr --rpc-host=HOST Communicate with coin daemon running on host HOST
rr --rpc-port=PORT Communicate with coin daemon listening on port PORT

View file

@ -52,7 +52,7 @@ class RPCClient:
self.host_url = f'{self.network_proto}://{host}:{port}'
self.host = host
self.port = port
self.timeout = self.cfg.http_timeout
self.timeout = self.cfg.http_timeout or 60
self.auth = None
def _get_backend(self, backend):