channel+cnct: remove preimage from channel and resolution

Now that the success resolver preimage field is always populated by the
incoming contest resolver, preimage lookups earlier in the
process (channel and channel arbitrator) can mostly be removed.
This commit is contained in:
Joost Jager
2019-04-15 14:24:43 +02:00
parent 6886a0117f
commit d55a8b7b29
14 changed files with 53 additions and 118 deletions

View File

@@ -367,11 +367,9 @@ func createTestChannel(alicePrivKey, bobPrivKey []byte,
aliceSigner := &mockSigner{aliceKeyPriv}
bobSigner := &mockSigner{bobKeyPriv}
pCache := newMockPreimageCache()
alicePool := lnwallet.NewSigPool(runtime.NumCPU(), aliceSigner)
channelAlice, err := lnwallet.NewLightningChannel(
aliceSigner, pCache, aliceChannelState, alicePool,
aliceSigner, aliceChannelState, alicePool,
)
if err != nil {
return nil, nil, nil, nil, err
@@ -380,7 +378,7 @@ func createTestChannel(alicePrivKey, bobPrivKey []byte,
bobPool := lnwallet.NewSigPool(runtime.NumCPU(), bobSigner)
channelBob, err := lnwallet.NewLightningChannel(
bobSigner, pCache, bobChannelState, bobPool,
bobSigner, bobChannelState, bobPool,
)
if err != nil {
return nil, nil, nil, nil, err
@@ -441,7 +439,7 @@ func createTestChannel(alicePrivKey, bobPrivKey []byte,
}
newAliceChannel, err := lnwallet.NewLightningChannel(
aliceSigner, nil, aliceStoredChannel, alicePool,
aliceSigner, aliceStoredChannel, alicePool,
)
if err != nil {
return nil, nil, errors.Errorf("unable to create new channel: %v",
@@ -481,7 +479,7 @@ func createTestChannel(alicePrivKey, bobPrivKey []byte,
}
newBobChannel, err := lnwallet.NewLightningChannel(
bobSigner, nil, bobStoredChannel, bobPool,
bobSigner, bobStoredChannel, bobPool,
)
if err != nil {
return nil, nil, errors.Errorf("unable to create new channel: %v",