multi: switch to lock time from sequence for coop close v2

This commit is contained in:
Olaoluwa Osuntokun committed 2024-12-10 23:07:01 +01:00
1 parent 2decea86d8
commit 540d3c0fc7
5 files changed
+18 -41

No files matched your search

+4 -4
View File
@@ -34,9 +34,9 @@ type ClosingComplete struct {
// channel would like to propose for the close transaction.
FeeSatoshis btcutil.Amount
// Sequence is the sequence number to be used in the input spending the
// LockTime is the locktime number to be used in the input spending the
// funding transaction.
Sequence uint32
LockTime uint32
// ClosingSigs houses the 3 possible signatures that can be sent.
ClosingSigs
@@ -79,7 +79,7 @@ func decodeClosingSigs(c *ClosingSigs, tlvRecords ExtraOpaqueData) error {
// passed io.Reader.
func (c *ClosingComplete) Decode(r io.Reader, _ uint32) error {
// First, read out all the fields that are hard coded into the message.
err := ReadElements(r, &c.ChannelID, &c.FeeSatoshis, &c.Sequence)
err := ReadElements(r, &c.ChannelID, &c.FeeSatoshis, &c.LockTime)
if err != nil {
return err
}
@@ -129,7 +129,7 @@ func (c *ClosingComplete) Encode(w *bytes.Buffer, _ uint32) error {
return err
}
if err := WriteUint32(w, c.Sequence); err != nil {
if err := WriteUint32(w, c.LockTime); err != nil {
return err
}
+1 -1
View File
@@ -1352,7 +1352,7 @@ func TestLightningWireProtocol(t *testing.T) {
req := ClosingComplete{
ChannelID: ChannelID(c),
FeeSatoshis: btcutil.Amount(r.Int63()),
Sequence: uint32(r.Int63()),
LockTime: uint32(r.Int63()),
ClosingSigs: ClosingSigs{},
}