mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-02-18 13:04:33 +01:00
Fixes bitcoin_cli
bitcoin_cli as a global variable in the main __init__.py was creating issues related to http.client.CannotSendRequest: Request-sent and connection re-usage. Define a new connection per request.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from pisa.rpc_errors import *
|
||||
from pisa import bitcoin_cli
|
||||
from pisa.logger import Logger
|
||||
from pisa.tools import bitcoin_cli
|
||||
from pisa.utils.auth_proxy import JSONRPCException
|
||||
from pisa.errors import UNKNOWN_JSON_RPC_EXCEPTION
|
||||
|
||||
@@ -20,7 +20,7 @@ class Carrier:
|
||||
def send_transaction(self, rawtx, txid):
|
||||
try:
|
||||
logger.info("Pushing transaction to the network", txid=txid, rawtx=rawtx)
|
||||
bitcoin_cli.sendrawtransaction(rawtx)
|
||||
bitcoin_cli().sendrawtransaction(rawtx)
|
||||
|
||||
receipt = Receipt(delivered=True)
|
||||
|
||||
@@ -70,7 +70,7 @@ class Carrier:
|
||||
@staticmethod
|
||||
def get_transaction(txid):
|
||||
try:
|
||||
tx_info = bitcoin_cli.getrawtransaction(txid, 1)
|
||||
tx_info = bitcoin_cli().getrawtransaction(txid, 1)
|
||||
|
||||
except JSONRPCException as e:
|
||||
tx_info = None
|
||||
|
||||
Reference in New Issue
Block a user