Commit graph

4 commits

Author SHA1 Message Date
ziggie
b720fd5cd5
chanstate: fix htlc copy
Copy all HTLC fields when cloning channel commitment state.

The old copy method only copied a subset of scalar fields and copied
into nil slices for Signature and ExtraData. Allocate those slices and
deep-copy custom record values so snapshots and channel copies retain
complete HTLC metadata.
2026-07-06 15:51:20 -03:00
ziggie
9dfb8c1e13
chanstate: move commitment diff types
Move CommitDiff and its forwarding reference types into chanstate. This
lets the next commitment store subinterface name pending remote commitment
state without importing channeldb.

Keep forwarding package persistence and commit-diff serialization in
channeldb for now. The aliases preserve existing call sites while the
KV backend code remains in place.
2026-07-06 15:50:50 -03:00
ziggie
ed0bda738e
chanstate: move log update type
Move LogUpdate into chanstate so commitment store interfaces can refer
to pending update state without importing channeldb.

Keep the log-update serialization helpers in channeldb. Those helpers
remain part of the existing KV disk format and can move with the KV
backend implementation later.
2026-07-06 15:50:50 -03:00
ziggie
43edd57d23
chanstate: move commitment value types
Move ChannelCommitment and HTLC into chanstate so upcoming store subinterfaces
can name commitment state without importing channeldb.

Leave the KV serialization helpers in channeldb and keep aliases for
existing call sites. This preserves the current disk format and keeps
backend-specific persistence code out of chanstate for now.
2026-07-06 15:50:49 -03:00