chainfee: allow specifying min relay feerate from API source

This commit adds a new expected field, `min_relay_feerate`, in the
response body returned from the API source, allowing the API to specify
a min relay feerate to be used instead of the FeePerKwFloor.

This change is backwards compatible as for an old API source which
doesn't specify the `min_relay_feerate`, it will be interpreted as zero.
This commit is contained in:
yyforyongyu committed 2024-07-24 20:05:00 +08:00
1 parent b10ebb2692
commit ce43e4bab7
5 files changed
+124 -32

No files matched your search

+2 -2
View File
@@ -12,10 +12,10 @@ type mockFeeSource struct {
// WebAPIFeeSource interface.
var _ WebAPIFeeSource = (*mockFeeSource)(nil)
func (m *mockFeeSource) GetFeeMap() (map[uint32]uint32, error) {
func (m *mockFeeSource) GetFeeInfo() (WebAPIResponse, error) {
args := m.Called()
return args.Get(0).(map[uint32]uint32), args.Error(1)
return args.Get(0).(WebAPIResponse), args.Error(1)
}
// MockEstimator implements the `Estimator` interface and is used by