Browse Source
lnpeer.channel_establishment_flow: check funding_sat in bounds earlier
closes #7169
patch-4
SomberNight
4 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
3 additions and
3 deletions
-
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, |
|
|
|