mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 12:30:07 +00:00
ln: save htlc signatures
This commit is contained in:
parent
bedf755565
commit
d4c00ee986
4 changed files with 7 additions and 3 deletions
|
@ -611,6 +611,7 @@ class Peer(PrintError):
|
|||
funding_locked_received = False,
|
||||
was_announced = False,
|
||||
current_commitment_signature = None,
|
||||
current_htlc_signatures = None,
|
||||
feerate=local_feerate
|
||||
),
|
||||
"constraints": ChannelConstraints(capacity=funding_sat, is_initiator=True, funding_txn_minimum_depth=funding_txn_minimum_depth)
|
||||
|
@ -1020,7 +1021,9 @@ class Peer(PrintError):
|
|||
self.print_error("commitment_signed", payload)
|
||||
channel_id = payload['channel_id']
|
||||
chan = self.channels[channel_id]
|
||||
chan.local_state=chan.local_state._replace(current_commitment_signature=payload['signature'])
|
||||
chan.local_state=chan.local_state._replace(
|
||||
current_commitment_signature=payload['signature'],
|
||||
current_htlc_signatures=payload['htlc_signature'])
|
||||
self.lnworker.save_channel(chan)
|
||||
self.commitment_signed[channel_id].put_nowait(payload)
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ is_key = lambda k: k.endswith("_basepoint") or k.endswith("_key")
|
|||
|
||||
def maybeDecode(k, v):
|
||||
assert type(v) is not list
|
||||
if k in ["node_id", "channel_id", "short_channel_id", "pubkey", "privkey", "current_per_commitment_point", "next_per_commitment_point", "per_commitment_secret_seed", "current_commitment_signature"] and v is not None:
|
||||
if k in ["node_id", "channel_id", "short_channel_id", "pubkey", "privkey", "current_per_commitment_point", "next_per_commitment_point", "per_commitment_secret_seed", "current_commitment_signature", "current_htlc_signatures"] and v is not None:
|
||||
return binascii.unhexlify(v)
|
||||
return v
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ ChannelConfig = namedtuple("ChannelConfig", [
|
|||
"to_self_delay", "dust_limit_sat", "max_htlc_value_in_flight_msat", "max_accepted_htlcs"])
|
||||
OnlyPubkeyKeypair = namedtuple("OnlyPubkeyKeypair", ["pubkey"])
|
||||
RemoteState = namedtuple("RemoteState", ["ctn", "next_per_commitment_point", "amount_msat", "revocation_store", "current_per_commitment_point", "next_htlc_id", "feerate"])
|
||||
LocalState = namedtuple("LocalState", ["ctn", "per_commitment_secret_seed", "amount_msat", "next_htlc_id", "funding_locked_received", "was_announced", "current_commitment_signature", "feerate"])
|
||||
LocalState = namedtuple("LocalState", ["ctn", "per_commitment_secret_seed", "amount_msat", "next_htlc_id", "funding_locked_received", "was_announced", "current_commitment_signature", "current_htlc_signatures", "feerate"])
|
||||
ChannelConstraints = namedtuple("ChannelConstraints", ["capacity", "is_initiator", "funding_txn_minimum_depth"])
|
||||
#OpenChannel = namedtuple("OpenChannel", ["channel_id", "short_channel_id", "funding_outpoint", "local_config", "remote_config", "remote_state", "local_state", "constraints", "node_id"])
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ def create_channel_state(funding_txid, funding_index, funding_sat, local_feerate
|
|||
funding_locked_received=True,
|
||||
was_announced=False,
|
||||
current_commitment_signature=None,
|
||||
current_htlc_signatures=None,
|
||||
feerate=local_feerate
|
||||
),
|
||||
"constraints":lnbase.ChannelConstraints(capacity=funding_sat, is_initiator=is_initiator, funding_txn_minimum_depth=3),
|
||||
|
|
Loading…
Add table
Reference in a new issue