contractcourt/commit_sweep_resolver: set sweep witness type based on witness script

We use the fact that we can tell whether the commit is local or remote
by inspecting the witness script. We cannot use the maturity delay
anymore, as we can have delayed to_remote outputs also now.

Co-authored-by: Joost Jager <joost.jager@gmail.com>
This commit is contained in:
Johan T. HalsethandJoost Jager committed 2020-03-09 12:10:59 +01:00
1 parent af68ff1640
commit 1f28bd8086
2 files changed
+31 -7

No files matched your search

@@ -133,6 +133,7 @@ func TestCommitSweepResolverNoDelay(t *testing.T) {
Output: &wire.TxOut{
Value: 100,
},
WitnessScript: []byte{0},
},
}
@@ -162,6 +163,7 @@ func TestCommitSweepResolverDelay(t *testing.T) {
Output: &wire.TxOut{
Value: amt,
},
WitnessScript: []byte{0},
},
MaturityDelay: 3,
SelfOutPoint: outpoint,