|
@ -483,13 +483,8 @@ class Peer(Logger): |
|
|
return bool(self.features & LnFeatures.OPTION_STATIC_REMOTEKEY_OPT) |
|
|
return bool(self.features & LnFeatures.OPTION_STATIC_REMOTEKEY_OPT) |
|
|
|
|
|
|
|
|
def make_local_config(self, funding_sat: int, push_msat: int, initiator: HTLCOwner) -> LocalConfig: |
|
|
def make_local_config(self, funding_sat: int, push_msat: int, initiator: HTLCOwner) -> LocalConfig: |
|
|
|
|
|
channel_seed = os.urandom(32) |
|
|
random_seed = os.urandom(32) |
|
|
initial_msat = funding_sat * 1000 - push_msat if initiator == LOCAL else push_msat |
|
|
if initiator == LOCAL: |
|
|
|
|
|
initial_msat = funding_sat * 1000 - push_msat |
|
|
|
|
|
else: |
|
|
|
|
|
initial_msat = push_msat |
|
|
|
|
|
|
|
|
|
|
|
if self.is_static_remotekey(): |
|
|
if self.is_static_remotekey(): |
|
|
# Note: in the future, if a CSV delay is added, |
|
|
# Note: in the future, if a CSV delay is added, |
|
|
# we will want to derive that key |
|
|
# we will want to derive that key |
|
@ -499,9 +494,8 @@ class Peer(Logger): |
|
|
static_remotekey = bfh(wallet.get_public_key(addr)) |
|
|
static_remotekey = bfh(wallet.get_public_key(addr)) |
|
|
else: |
|
|
else: |
|
|
static_remotekey = None |
|
|
static_remotekey = None |
|
|
|
|
|
|
|
|
local_config = LocalConfig.from_seed( |
|
|
local_config = LocalConfig.from_seed( |
|
|
seed=random_seed, |
|
|
channel_seed=channel_seed, |
|
|
static_remotekey=static_remotekey, |
|
|
static_remotekey=static_remotekey, |
|
|
to_self_delay=DEFAULT_TO_SELF_DELAY, |
|
|
to_self_delay=DEFAULT_TO_SELF_DELAY, |
|
|
dust_limit_sat=546, |
|
|
dust_limit_sat=546, |
|
|