diff --git a/electrum/lnhtlc.py b/electrum/lnhtlc.py index 85b6ec2e1..bf7a3d199 100644 --- a/electrum/lnhtlc.py +++ b/electrum/lnhtlc.py @@ -284,7 +284,7 @@ class HTLCManager: @with_lock def get_unacked_local_updates(self) -> Dict[int, Sequence[bytes]]: #return self.log[LOCAL]['unacked_updates'] - return {int(ctn): [bfh(msg) for msg in messages] + return {ctn: [bfh(msg) for msg in messages] for ctn, messages in self.log[LOCAL]['unacked_updates'].items()} ##### Queries re HTLCs: @@ -340,7 +340,6 @@ class HTLCManager: htlc_proposer: HTLCOwner, htlc_id: int, ) -> bool: - htlc_id = int(htlc_id) if htlc_id >= self.get_next_htlc_id(htlc_proposer): return False ctns = self.log[htlc_proposer]['locked_in'][htlc_id] @@ -381,7 +380,6 @@ class HTLCManager: htlc_proposer: HTLCOwner, htlc_id: int, ) -> bool: - htlc_id = int(htlc_id) if htlc_id >= self.get_next_htlc_id(htlc_proposer): return False if htlc_id in self.log[htlc_proposer]['settles']: diff --git a/electrum/wallet_db.py b/electrum/wallet_db.py index 3e406a991..6b6a862a8 100644 --- a/electrum/wallet_db.py +++ b/electrum/wallet_db.py @@ -1358,7 +1358,8 @@ class WalletDB(JsonDB): elif key == 'data_loss_protect_remote_pcp': v = dict((k, bfh(x)) for k, x in v.items()) # convert htlc_id keys to int - if key in ['adds', 'locked_in', 'settles', 'fails', 'fee_updates', 'buckets']: + if key in ['adds', 'locked_in', 'settles', 'fails', 'fee_updates', 'buckets', + 'unacked_updates', 'unfulfilled_htlcs', 'fail_htlc_reasons', 'onion_keys']: v = dict((int(k), x) for k, x in v.items()) # convert keys to HTLCOwner if key == 'log' or (path and path[-1] in ['locked_in', 'fails', 'settles']):