mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-17 22:24:21 +01:00
htlcswitch/test: move preimage cache to server level
In this commit the preimage cache is instantiated on the mock server level where it belongs. Previously it was a cache shared across all mock servers.
This commit is contained in:
@@ -971,7 +971,6 @@ type hopNetwork struct {
|
||||
feeEstimator *mockFeeEstimator
|
||||
globalPolicy ForwardingPolicy
|
||||
obfuscator ErrorEncrypter
|
||||
pCache *mockPreimageCache
|
||||
|
||||
defaultDelta uint32
|
||||
}
|
||||
@@ -979,8 +978,6 @@ type hopNetwork struct {
|
||||
func newHopNetwork() *hopNetwork {
|
||||
defaultDelta := uint32(6)
|
||||
|
||||
pCache := newMockPreimageCache()
|
||||
|
||||
globalPolicy := ForwardingPolicy{
|
||||
MinHTLC: lnwire.NewMSatFromSatoshis(5),
|
||||
BaseFee: lnwire.NewMSatFromSatoshis(1),
|
||||
@@ -997,7 +994,6 @@ func newHopNetwork() *hopNetwork {
|
||||
feeEstimator: feeEstimator,
|
||||
globalPolicy: globalPolicy,
|
||||
obfuscator: obfuscator,
|
||||
pCache: pCache,
|
||||
defaultDelta: defaultDelta,
|
||||
}
|
||||
}
|
||||
@@ -1028,7 +1024,7 @@ func (h *hopNetwork) createChannelLink(server, peer *mockServer,
|
||||
FetchLastChannelUpdate: mockGetChanUpdateMessage,
|
||||
Registry: server.registry,
|
||||
FeeEstimator: h.feeEstimator,
|
||||
PreimageCache: h.pCache,
|
||||
PreimageCache: server.pCache,
|
||||
UpdateContractSignals: func(*contractcourt.ContractSignals) error {
|
||||
return nil
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user