mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-18 22:54:23 +01:00
small fixes
This commit is contained in:
@@ -77,7 +77,7 @@ def process_request():
|
|||||||
|
|
||||||
if isinstance(txid, str):
|
if isinstance(txid, str):
|
||||||
if check_txid_format(txid):
|
if check_txid_format(txid):
|
||||||
if txid not in mempool and txid not in list(mined_transactions.keys()):
|
if txid not in list(mined_transactions.keys()):
|
||||||
mempool.append(txid)
|
mempool.append(txid)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@@ -100,6 +100,9 @@ def process_request():
|
|||||||
if block:
|
if block:
|
||||||
response["result"] = {"confirmations": len(blockchain) - block.get('height')}
|
response["result"] = {"confirmations": len(blockchain) - block.get('height')}
|
||||||
|
|
||||||
|
elif txid in mempool:
|
||||||
|
response["result"] = {"confirmations": 0}
|
||||||
|
|
||||||
else:
|
else:
|
||||||
response["error"] = {'code': RPC_INVALID_ADDRESS_OR_KEY,
|
response["error"] = {'code': RPC_INVALID_ADDRESS_OR_KEY,
|
||||||
'message': 'No such mempool or blockchain transaction. Use gettransaction for '
|
'message': 'No such mempool or blockchain transaction. Use gettransaction for '
|
||||||
|
|||||||
Reference in New Issue
Block a user