ThomasV 3 years ago
parent
commit
7625b4e63b
  1. 13
      electrum/address_synchronizer.py
  2. 4
      electrum/util.py

13
electrum/address_synchronizer.py

@ -244,12 +244,13 @@ class AddressSynchronizer(Logger, EventListener):
def get_transaction(self, txid: str) -> Transaction: def get_transaction(self, txid: str) -> Transaction:
tx = self.db.get_transaction(txid) tx = self.db.get_transaction(txid)
# add verified tx info if tx:
tx.deserialize() # add verified tx info
for txin in tx._inputs: tx.deserialize()
tx_height, tx_pos = self.get_txpos(txin.prevout.txid.hex()) for txin in tx._inputs:
txin.block_height = tx_height tx_height, tx_pos = self.get_txpos(txin.prevout.txid.hex())
txin.block_txpos = tx_pos txin.block_height = tx_height
txin.block_txpos = tx_pos
return tx return tx
def add_transaction(self, tx: Transaction, *, allow_unrelated=False, is_new=True) -> bool: def add_transaction(self, tx: Transaction, *, allow_unrelated=False, is_new=True) -> bool:

4
electrum/util.py

@ -1289,7 +1289,7 @@ class TxMinedInfo(NamedTuple):
class ShortID(bytes): class ShortID(bytes):
def __repr__(self): def __repr__(self):
return f"<ShortID: {format_short_channel_id(self)}>" return f"<ShortID: {format_short_id(self)}>"
def __str__(self): def __str__(self):
return format_short_id(self) return format_short_id(self)
@ -1314,7 +1314,7 @@ class ShortID(bytes):
return ShortID.from_components(*components) return ShortID.from_components(*components)
@classmethod @classmethod
def normalize(cls, data: Union[None, str, bytes, 'ShortChannelID']) -> Optional['ShortChannelID']: def normalize(cls, data: Union[None, str, bytes, 'ShortID']) -> Optional['ShortID']:
if isinstance(data, ShortID) or data is None: if isinstance(data, ShortID) or data is None:
return data return data
if isinstance(data, str): if isinstance(data, str):

Loading…
Cancel
Save