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. Halseth
2020-03-06 16:11:46 +01:00
parent af68ff1640
commit 1f28bd8086
2 changed files with 31 additions and 7 deletions

View File

@@ -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,