Merge pull request #2431 from cfromknecht/keyring-remote-delay-retribution
lnwallet: Add keyring and remote CSV delay to BreachRetribution
This commit is contained in:
commit
400a1d3282
@ -743,13 +743,27 @@ func (c *chainWatcher) dispatchContractBreach(spendEvent *chainntnfs.SpendDetail
|
|||||||
retribution.RemoteOutputSignDesc.DoubleTweak != nil {
|
retribution.RemoteOutputSignDesc.DoubleTweak != nil {
|
||||||
retribution.RemoteOutputSignDesc.DoubleTweak.Curve = nil
|
retribution.RemoteOutputSignDesc.DoubleTweak.Curve = nil
|
||||||
}
|
}
|
||||||
|
if retribution.RemoteOutputSignDesc != nil &&
|
||||||
|
retribution.RemoteOutputSignDesc.KeyDesc.PubKey != nil {
|
||||||
|
retribution.RemoteOutputSignDesc.KeyDesc.PubKey.Curve = nil
|
||||||
|
}
|
||||||
if retribution.LocalOutputSignDesc != nil &&
|
if retribution.LocalOutputSignDesc != nil &&
|
||||||
retribution.LocalOutputSignDesc.DoubleTweak != nil {
|
retribution.LocalOutputSignDesc.DoubleTweak != nil {
|
||||||
retribution.LocalOutputSignDesc.DoubleTweak.Curve = nil
|
retribution.LocalOutputSignDesc.DoubleTweak.Curve = nil
|
||||||
}
|
}
|
||||||
|
if retribution.LocalOutputSignDesc != nil &&
|
||||||
|
retribution.LocalOutputSignDesc.KeyDesc.PubKey != nil {
|
||||||
|
retribution.LocalOutputSignDesc.KeyDesc.PubKey.Curve = nil
|
||||||
|
}
|
||||||
|
|
||||||
log.Debugf("Punishment breach retribution created: %v",
|
log.Debugf("Punishment breach retribution created: %v",
|
||||||
newLogClosure(func() string {
|
newLogClosure(func() string {
|
||||||
|
retribution.KeyRing.CommitPoint.Curve = nil
|
||||||
|
retribution.KeyRing.LocalHtlcKey = nil
|
||||||
|
retribution.KeyRing.RemoteHtlcKey = nil
|
||||||
|
retribution.KeyRing.DelayKey = nil
|
||||||
|
retribution.KeyRing.NoDelayKey = nil
|
||||||
|
retribution.KeyRing.RevocationKey = nil
|
||||||
return spew.Sdump(retribution)
|
return spew.Sdump(retribution)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
@ -1891,6 +1891,15 @@ type BreachRetribution struct {
|
|||||||
// HtlcRetributions is a slice of HTLC retributions for each output
|
// HtlcRetributions is a slice of HTLC retributions for each output
|
||||||
// active HTLC output within the breached commitment transaction.
|
// active HTLC output within the breached commitment transaction.
|
||||||
HtlcRetributions []HtlcRetribution
|
HtlcRetributions []HtlcRetribution
|
||||||
|
|
||||||
|
// KeyRing contains the derived public keys used to construct the
|
||||||
|
// breaching commitment transaction. This allows downstream clients to
|
||||||
|
// have access to the public keys used in the scripts.
|
||||||
|
KeyRing *CommitmentKeyRing
|
||||||
|
|
||||||
|
// RemoteDelay specifies the CSV delay applied to to-local scripts on
|
||||||
|
// the breaching commitment transaction.
|
||||||
|
RemoteDelay uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBreachRetribution creates a new fully populated BreachRetribution for the
|
// NewBreachRetribution creates a new fully populated BreachRetribution for the
|
||||||
@ -2098,6 +2107,8 @@ func NewBreachRetribution(chanState *channeldb.OpenChannel, stateNum uint64,
|
|||||||
RemoteOutpoint: remoteOutpoint,
|
RemoteOutpoint: remoteOutpoint,
|
||||||
RemoteOutputSignDesc: remoteSignDesc,
|
RemoteOutputSignDesc: remoteSignDesc,
|
||||||
HtlcRetributions: htlcRetributions,
|
HtlcRetributions: htlcRetributions,
|
||||||
|
KeyRing: keyRing,
|
||||||
|
RemoteDelay: remoteDelay,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user