lnpeer.channel_establishment_flow: check funding_sat in bounds earlier
closes #7169
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user