fix uncaught error returning transactions that dont yet exist
This commit is contained in:
parent
78bd2da267
commit
76dd9c392b
2 changed files with 4 additions and 10 deletions
|
@ -347,14 +347,9 @@ INVALID_ARGS = -32602
|
|||
|
||||
|
||||
class CodeMessageError(Exception):
|
||||
|
||||
@property
|
||||
def code(self):
|
||||
return self.args[0]
|
||||
|
||||
@property
|
||||
def message(self):
|
||||
return self.args[1]
|
||||
def __init__(self, code: int, message: str):
|
||||
self.code = code
|
||||
self.message = message
|
||||
|
||||
def __eq__(self, other):
|
||||
return (isinstance(other, self.__class__) and
|
||||
|
@ -382,7 +377,6 @@ class RPCError(CodeMessageError):
|
|||
pass
|
||||
|
||||
|
||||
|
||||
class DaemonError(Exception):
|
||||
"""Raised when the daemon returns an error in its results."""
|
||||
|
||||
|
|
|
@ -1750,7 +1750,7 @@ class LBRYElectrumX(asyncio.Protocol):
|
|||
if not verbose:
|
||||
return raw_tx.hex()
|
||||
return self.coin.transaction(raw_tx).as_dict(self.coin)
|
||||
return RPCError("No such mempool or blockchain transaction.")
|
||||
return RPCError(BAD_REQUEST, "No such mempool or blockchain transaction.")
|
||||
|
||||
def _get_merkle_branch(self, tx_hashes, tx_pos):
|
||||
"""Return a merkle branch to a transaction.
|
||||
|
|
Loading…
Reference in a new issue