channeldb: remove RevocationDelay field from the HTLC struct
This commit removes the RevocationDelay field from the HTLC struct as with the latest commitment transaction scheme, it is no longer needed. This is due to the fact the the delay is now observed when an on-chain HTLC claim is attempted, rather than from Shane the HTLC itself has been broadcast.
This commit is contained in:
parent
e87cc29b36
commit
88c15abeef
@ -530,13 +530,6 @@ type HTLC struct {
|
||||
// must wait before reclaiming the funds in limbo.
|
||||
RefundTimeout uint32
|
||||
|
||||
// RevocationDelay is the relative timeout the party who broadcasts the
|
||||
// commitment transaction must wait before being able to fully sweep
|
||||
// the funds on-chain in the case of a unilateral channel closure.
|
||||
//
|
||||
// TODO(roasbeef): no longer needed?
|
||||
RevocationDelay uint32
|
||||
|
||||
// OutputIndex is the output index for this particular HTLC output
|
||||
// within the commitment transaction.
|
||||
OutputIndex int32
|
||||
@ -552,7 +545,6 @@ func (h *HTLC) Copy() HTLC {
|
||||
Incoming: h.Incoming,
|
||||
Amt: h.Amt,
|
||||
RefundTimeout: h.RefundTimeout,
|
||||
RevocationDelay: h.RevocationDelay,
|
||||
OutputIndex: h.OutputIndex,
|
||||
}
|
||||
copy(clone.Signature[:], h.Signature)
|
||||
@ -2045,9 +2037,6 @@ func serializeHTLC(w io.Writer, h *HTLC) error {
|
||||
if err := binary.Write(w, byteOrder, h.RefundTimeout); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := binary.Write(w, byteOrder, h.RevocationDelay); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := binary.Write(w, byteOrder, h.OutputIndex); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -2085,9 +2074,6 @@ func deserializeHTLC(r io.Reader) (*HTLC, error) {
|
||||
if err := binary.Read(r, byteOrder, &h.RefundTimeout); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := binary.Read(r, byteOrder, &h.RevocationDelay); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := binary.Read(r, byteOrder, &h.OutputIndex); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -210,7 +210,6 @@ func TestOpenChannelPutGetDelete(t *testing.T) {
|
||||
Amt: 10,
|
||||
RHash: key,
|
||||
RefundTimeout: 1,
|
||||
RevocationDelay: 2,
|
||||
},
|
||||
}
|
||||
if err := state.FullSync(); err != nil {
|
||||
@ -353,13 +352,14 @@ func TestChannelStateTransition(t *testing.T) {
|
||||
Amt: 10,
|
||||
RHash: key,
|
||||
RefundTimeout: i,
|
||||
RevocationDelay: i + 2,
|
||||
OutputIndex: int32(i * 3),
|
||||
}
|
||||
htlcs = append(htlcs, htlc)
|
||||
htlcAmt += htlc.Amt
|
||||
}
|
||||
|
||||
// TODO(roasbeef): ensure that expiry matches
|
||||
|
||||
// Create a new channel delta which includes the above HTLCs, some
|
||||
// balance updates, and an increment of the current commitment height.
|
||||
// Additionally, modify the signature and commitment transaction.
|
||||
|
Loading…
Reference in New Issue
Block a user