multi: remove breach tx arg from NewBreachRetribution args
This commit removes the breach transaction from the arguments passed to NewBreachRetribution. We already keep all prior remote commitments on disk in the commitment log, and load that transaction from disk inside the method. In practice, the one loaded from disk will be the same one that is passed in by the caller, so there should be no change in behavior as we've already derived the appropriate state number. This changes makes integration with the watchtower client simpler, since we no longer need to acquire the breaching commitment transaction to be able to construct the BreachRetribution. This simplifies not only the logic surrounding transient backsups, but also on startup (and later, retroactively backing up historic updates).
This commit is contained in:
4 files changed
+8
-14
No files matched your search
@@ -5389,7 +5389,6 @@ func TestNewBreachRetributionSkipsDustHtlcs(t *testing.T) {
|
||||
|
||||
// At this point, we'll capture the current state number, as well as
|
||||
// the current commitment.
|
||||
revokedCommit := bobChannel.channelState.LocalCommitment.CommitTx
|
||||
revokedStateNum := aliceChannel.channelState.LocalCommitment.CommitHeight
|
||||
|
||||
// We'll now have Bob settle those HTLC's to Alice and then advance
|
||||
@@ -5411,7 +5410,7 @@ func TestNewBreachRetributionSkipsDustHtlcs(t *testing.T) {
|
||||
// At this point, we'll now simulate a contract breach by Bob using the
|
||||
// NewBreachRetribution method.
|
||||
breachRet, err := NewBreachRetribution(
|
||||
aliceChannel.channelState, revokedStateNum, revokedCommit, 100,
|
||||
aliceChannel.channelState, revokedStateNum, 100,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to create breach retribution: %v", err)
|
||||
|
||||
Reference in new issue
Block a user