commit 05e58671c92940620aab36cf5946a0f1dd24c013
parent 54f7755397f5c4a4ce3215ddad70f342f06cf9fe
Author: SomberNight <somber.night@protonmail.com>
Date: Thu, 11 Mar 2021 19:09:35 +0100
lnhtlc: (trivial) rename method
Diffstat:
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/electrum/lnhtlc.py b/electrum/lnhtlc.py
@@ -320,7 +320,7 @@ class HTLCManager:
return False
@with_lock
- def is_add_htlc_irrevocably_committed_yet(
+ def is_htlc_irrevocably_added_yet(
self,
*,
ctx_owner: HTLCOwner = None,
@@ -330,9 +330,9 @@ class HTLCManager:
"""Returns whether `add_htlc` was irrevocably committed to `ctx_owner's` ctx.
If `ctx_owner` is None, both parties' ctxs are checked.
"""
- in_local = self._is_add_htlc_irrevocably_committed_yet(
+ in_local = self._is_htlc_irrevocably_added_yet(
ctx_owner=LOCAL, htlc_proposer=htlc_proposer, htlc_id=htlc_id)
- in_remote = self._is_add_htlc_irrevocably_committed_yet(
+ in_remote = self._is_htlc_irrevocably_added_yet(
ctx_owner=REMOTE, htlc_proposer=htlc_proposer, htlc_id=htlc_id)
if ctx_owner is None:
return in_local and in_remote
@@ -344,7 +344,7 @@ class HTLCManager:
raise Exception(f"unexpected ctx_owner: {ctx_owner!r}")
@with_lock
- def _is_add_htlc_irrevocably_committed_yet(
+ def _is_htlc_irrevocably_added_yet(
self,
*,
ctx_owner: HTLCOwner,
diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py
@@ -1574,7 +1574,7 @@ class Peer(Logger):
def fulfill_htlc(self, chan: Channel, htlc_id: int, preimage: bytes):
self.logger.info(f"_fulfill_htlc. chan {chan.short_channel_id}. htlc_id {htlc_id}")
assert chan.can_send_ctx_updates(), f"cannot send updates: {chan.short_channel_id}"
- assert chan.hm.is_add_htlc_irrevocably_committed_yet(htlc_proposer=REMOTE, htlc_id=htlc_id)
+ assert chan.hm.is_htlc_irrevocably_added_yet(htlc_proposer=REMOTE, htlc_id=htlc_id)
chan.settle_htlc(preimage, htlc_id)
self.send_message(
"update_fulfill_htlc",
@@ -1809,7 +1809,7 @@ class Peer(Logger):
done = set()
unfulfilled = chan.hm.log.get('unfulfilled_htlcs', {})
for htlc_id, (local_ctn, remote_ctn, onion_packet_hex, forwarding_info) in unfulfilled.items():
- if not chan.hm.is_add_htlc_irrevocably_committed_yet(htlc_proposer=REMOTE, htlc_id=htlc_id):
+ if not chan.hm.is_htlc_irrevocably_added_yet(htlc_proposer=REMOTE, htlc_id=htlc_id):
continue
htlc = chan.hm.get_htlc_by_id(REMOTE, htlc_id)
error_reason = None # type: Optional[OnionRoutingFailure]