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:
5 files changed
+105
-62
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user