Browse Source

lnpeer.channel_establishment_flow: check funding_sat in bounds earlier

closes #7169
patch-4
SomberNight 4 years ago
parent
commit
d62a4833e5
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 6
      electrum/lnpeer.py

6
electrum/lnpeer.py

@ -600,9 +600,6 @@ class Peer(Logger):
if not self.lnworker.channel_db and not self.lnworker.is_trampoline_peer(self.pubkey):
raise Exception('Not a trampoline node: ' + str(self.their_features))
feerate = self.lnworker.current_feerate_per_kw()
local_config = self.make_local_config(funding_sat, push_msat, LOCAL)
if funding_sat > LN_MAX_FUNDING_SAT:
raise Exception(
f"MUST set funding_satoshis to less than 2^24 satoshi. "
@ -614,6 +611,9 @@ class Peer(Logger):
if funding_sat < lnutil.MIN_FUNDING_SAT:
raise Exception(f"funding_sat too low: {funding_sat} < {lnutil.MIN_FUNDING_SAT}")
feerate = self.lnworker.current_feerate_per_kw()
local_config = self.make_local_config(funding_sat, push_msat, LOCAL)
# for the first commitment transaction
per_commitment_secret_first = get_per_commitment_secret_from_seed(
local_config.per_commitment_secret_seed,

Loading…
Cancel
Save