lnwallet: use channel type to derive remote script

Based on the current channel type, we derive the script used for the
to_remote output. Currently only the unencumbered p2wkh type is used,
but that will change with upcoming channel types.
This commit is contained in:
Johan T. Halseth committed 2020-01-06 12:08:19 +01:00
1 parent 9b5809a884
commit a56ed72bd7
5 files changed
+105 -62

No files matched your search

+4 -2
View File
@@ -1048,8 +1048,10 @@ func testSpendValidation(t *testing.T, tweakless bool) {
// our commitments, if it's tweakless, his key will just be his regular
// pubkey.
bobPayKey := input.TweakPubKey(bobKeyPub, commitPoint)
channelType := channeldb.SingleFunderBit
if tweakless {
bobPayKey = bobKeyPub
channelType = channeldb.SingleFunderTweaklessBit
}
aliceCommitTweak := input.SingleTweakBytes(commitPoint, aliceKeyPub)
@@ -1086,8 +1088,8 @@ func testSpendValidation(t *testing.T, tweakless bool) {
ToRemoteKey: bobPayKey,
}
commitmentTx, err := CreateCommitTx(
*fakeFundingTxIn, keyRing, aliceChanCfg, bobChanCfg,
channelBalance, channelBalance,
channelType, *fakeFundingTxIn, keyRing, aliceChanCfg,
bobChanCfg, channelBalance, channelBalance,
)
if err != nil {
t.Fatalf("unable to create commitment transaction: %v", nil)