1
0

lnworker.open_channel: move max funding_sat check deeper in call stack

open_channel_with_peer was missing this check
This commit is contained in:
SomberNight
2025-01-13 14:53:16 +00:00
parent 68a2e4e399
commit 8f5b395ddc

View File

@@ -1311,8 +1311,14 @@ class LNWallet(LNWorker):
public: bool,
zeroconf=False,
opening_fee=None,
password: Optional[str]) -> Tuple[Channel, PartialTransaction]:
password: Optional[str],
) -> Tuple[Channel, PartialTransaction]:
if funding_sat > self.config.LIGHTNING_MAX_FUNDING_SAT:
raise Exception(
_("Requested channel capacity is over maximum.")
+ f"\n{funding_sat} sat > {self.config.LIGHTNING_MAX_FUNDING_SAT} sat"
)
coro = peer.channel_establishment_flow(
funding_tx=funding_tx,
funding_sat=funding_sat,
@@ -1409,10 +1415,8 @@ class LNWallet(LNWorker):
funding_sat: int,
push_amt_sat: int,
public: bool = False,
password: str = None) -> Tuple[Channel, PartialTransaction]:
if funding_sat > self.config.LIGHTNING_MAX_FUNDING_SAT:
raise Exception(_("Requested channel capacity is over maximum."))
password: str = None,
) -> Tuple[Channel, PartialTransaction]:
fut = asyncio.run_coroutine_threadsafe(self.add_peer(connect_str), self.network.asyncio_loop)
try: