lnwallet: create CommitmentBuilder

We define a new struct CommitmentBuilder that will be used to craft the
final commitment transaction based on the current active channel type.
This commit is contained in:
Johan T. Halseth
2020-01-06 11:42:03 +01:00
parent 13a108e578
commit 613d771daf
4 changed files with 58 additions and 35 deletions

View File

@@ -324,6 +324,8 @@ func CreateTestChannels(tweaklessCommits bool) (
}
alicePool.Start()
obfuscator := createStateHintObfuscator(aliceChannelState)
bobPool := NewSigPool(1, bobSigner)
channelBob, err := NewLightningChannel(
bobSigner, bobChannelState, bobPool,
@@ -334,13 +336,13 @@ func CreateTestChannels(tweaklessCommits bool) (
bobPool.Start()
err = SetStateNumHint(
aliceCommitTx, 0, channelAlice.stateHintObfuscator,
aliceCommitTx, 0, obfuscator,
)
if err != nil {
return nil, nil, nil, err
}
err = SetStateNumHint(
bobCommitTx, 0, channelAlice.stateHintObfuscator,
bobCommitTx, 0, obfuscator,
)
if err != nil {
return nil, nil, nil, err