Browse Source
interface.get_transaction: stricter sanitisation
in particular, Transaction.__init__ allows leading/trailing whitespaces
patch-4
SomberNight
4 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
2 additions and
0 deletions
-
electrum/interface.py
|
@ -917,6 +917,8 @@ class Interface(Logger): |
|
|
raise Exception(f"{repr(tx_hash)} is not a txid") |
|
|
raise Exception(f"{repr(tx_hash)} is not a txid") |
|
|
raw = await self.session.send_request('blockchain.transaction.get', [tx_hash], timeout=timeout) |
|
|
raw = await self.session.send_request('blockchain.transaction.get', [tx_hash], timeout=timeout) |
|
|
# validate response |
|
|
# validate response |
|
|
|
|
|
if not is_hex_str(raw): |
|
|
|
|
|
raise RequestCorrupted(f"received garbage (non-hex) as tx data (txid {tx_hash}): {raw!r}") |
|
|
tx = Transaction(raw) |
|
|
tx = Transaction(raw) |
|
|
try: |
|
|
try: |
|
|
tx.deserialize() # see if raises |
|
|
tx.deserialize() # see if raises |
|
|