mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-02 12:08:45 +02:00
htlcswitch: respect minimum relay fee
When channels fee rates are being considered for an update, the minimum relay fee should also be considered.
This commit is contained in:
@@ -71,6 +71,7 @@ func (m *mockPreimageCache) SubscribeUpdates() *contractcourt.WitnessSubscriptio
|
||||
|
||||
type mockFeeEstimator struct {
|
||||
byteFeeIn chan chainfee.SatPerKWeight
|
||||
relayFee chan chainfee.SatPerKWeight
|
||||
|
||||
quit chan struct{}
|
||||
}
|
||||
@@ -78,6 +79,7 @@ type mockFeeEstimator struct {
|
||||
func newMockFeeEstimator() *mockFeeEstimator {
|
||||
return &mockFeeEstimator{
|
||||
byteFeeIn: make(chan chainfee.SatPerKWeight),
|
||||
relayFee: make(chan chainfee.SatPerKWeight),
|
||||
quit: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
@@ -94,7 +96,12 @@ func (m *mockFeeEstimator) EstimateFeePerKW(
|
||||
}
|
||||
|
||||
func (m *mockFeeEstimator) RelayFeePerKW() chainfee.SatPerKWeight {
|
||||
return 1e3
|
||||
select {
|
||||
case feeRate := <-m.relayFee:
|
||||
return feeRate
|
||||
case <-m.quit:
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
func (m *mockFeeEstimator) Start() error {
|
||||
|
Reference in New Issue
Block a user