cleanup old non-static_remotekey code (follow-up 1f403d1ca1)
This commit is contained in:
@@ -600,9 +600,6 @@ class Peer(Logger):
|
|||||||
def is_shutdown_anysegwit(self):
|
def is_shutdown_anysegwit(self):
|
||||||
return self.features.supports(LnFeatures.OPTION_SHUTDOWN_ANYSEGWIT_OPT)
|
return self.features.supports(LnFeatures.OPTION_SHUTDOWN_ANYSEGWIT_OPT)
|
||||||
|
|
||||||
def is_static_remotekey(self):
|
|
||||||
return self.features.supports(LnFeatures.OPTION_STATIC_REMOTEKEY_OPT)
|
|
||||||
|
|
||||||
def is_channel_type(self):
|
def is_channel_type(self):
|
||||||
return self.features.supports(LnFeatures.OPTION_CHANNEL_TYPE_OPT)
|
return self.features.supports(LnFeatures.OPTION_CHANNEL_TYPE_OPT)
|
||||||
|
|
||||||
@@ -631,13 +628,12 @@ class Peer(Logger):
|
|||||||
# flexibility to decide an address at closing time
|
# flexibility to decide an address at closing time
|
||||||
upfront_shutdown_script = b''
|
upfront_shutdown_script = b''
|
||||||
|
|
||||||
if channel_type & channel_type.OPTION_STATIC_REMOTEKEY:
|
assert channel_type & channel_type.OPTION_STATIC_REMOTEKEY
|
||||||
wallet = self.lnworker.wallet
|
wallet = self.lnworker.wallet
|
||||||
assert wallet.txin_type == 'p2wpkh'
|
assert wallet.txin_type == 'p2wpkh'
|
||||||
addr = wallet.get_new_sweep_address_for_channel()
|
addr = wallet.get_new_sweep_address_for_channel()
|
||||||
static_remotekey = bfh(wallet.get_public_key(addr))
|
static_remotekey = bytes.fromhex(wallet.get_public_key(addr))
|
||||||
else:
|
|
||||||
static_remotekey = None
|
|
||||||
dust_limit_sat = bitcoin.DUST_LIMIT_P2PKH
|
dust_limit_sat = bitcoin.DUST_LIMIT_P2PKH
|
||||||
reserve_sat = max(funding_sat // 100, dust_limit_sat)
|
reserve_sat = max(funding_sat // 100, dust_limit_sat)
|
||||||
# for comparison of defaults, see
|
# for comparison of defaults, see
|
||||||
@@ -708,10 +704,9 @@ class Peer(Logger):
|
|||||||
feerate = self.lnworker.current_feerate_per_kw()
|
feerate = self.lnworker.current_feerate_per_kw()
|
||||||
# we set a channel type for internal bookkeeping
|
# we set a channel type for internal bookkeeping
|
||||||
open_channel_tlvs = {}
|
open_channel_tlvs = {}
|
||||||
if self.their_features.supports(LnFeatures.OPTION_STATIC_REMOTEKEY_OPT):
|
assert self.their_features.supports(LnFeatures.OPTION_STATIC_REMOTEKEY_OPT)
|
||||||
our_channel_type = ChannelType(ChannelType.OPTION_STATIC_REMOTEKEY)
|
our_channel_type = ChannelType(ChannelType.OPTION_STATIC_REMOTEKEY)
|
||||||
else:
|
|
||||||
our_channel_type = ChannelType(0)
|
|
||||||
# if option_channel_type is negotiated: MUST set channel_type
|
# if option_channel_type is negotiated: MUST set channel_type
|
||||||
if self.is_channel_type():
|
if self.is_channel_type():
|
||||||
# if it includes channel_type: MUST set it to a defined type representing the type it wants.
|
# if it includes channel_type: MUST set it to a defined type representing the type it wants.
|
||||||
|
|||||||
Reference in New Issue
Block a user