diff --git a/config.go b/config.go index e35cb7b..2b4cb41 100644 --- a/config.go +++ b/config.go @@ -41,9 +41,10 @@ type Config struct { Proxy proxy.Dialer // The default fee-per-byte for each level - LowFee uint64 - MediumFee uint64 - HighFee uint64 + SuperLowFee uint64 + LowFee uint64 + MediumFee uint64 + HighFee uint64 // The highest allowable fee-per-byte MaxFee uint64 diff --git a/fees.go b/fees.go index 0e83286..935021a 100644 --- a/fees.go +++ b/fees.go @@ -19,31 +19,34 @@ type feeCache struct { } type Fees struct { - Priority uint64 `json:"priority"` - Normal uint64 `json:"normal"` - Economic uint64 `json:"economic"` + Priority uint64 `json:"priority"` + Normal uint64 `json:"normal"` + Economic uint64 `json:"economic"` + SuperEconomic uint64 `json:"superEconomic"` } type FeeProvider struct { - maxFee uint64 - priorityFee uint64 - normalFee uint64 - economicFee uint64 - feeAPI string + maxFee uint64 + priorityFee uint64 + normalFee uint64 + economicFee uint64 + superEconomicFee uint64 + feeAPI string httpClient httpClient cache *feeCache } -func NewFeeProvider(maxFee, priorityFee, normalFee, economicFee uint64, feeAPI string, proxy proxy.Dialer) *FeeProvider { +func NewFeeProvider(maxFee, priorityFee, normalFee, economicFee, superEconomicFee uint64, feeAPI string, proxy proxy.Dialer) *FeeProvider { fp := FeeProvider{ - maxFee: maxFee, - priorityFee: priorityFee, - normalFee: normalFee, - economicFee: economicFee, - feeAPI: feeAPI, - cache: new(feeCache), + maxFee: maxFee, + priorityFee: priorityFee, + normalFee: normalFee, + economicFee: economicFee, + superEconomicFee: superEconomicFee, + feeAPI: feeAPI, + cache: new(feeCache), } dial := net.Dial if proxy != nil { @@ -84,6 +87,8 @@ func (fp *FeeProvider) GetFeePerByte(feeLevel wallet.FeeLevel) uint64 { return fp.selectFee(fees.Normal, wallet.PRIOIRTY) case wallet.ECONOMIC: return fp.selectFee(fees.Economic, wallet.PRIOIRTY) + case wallet.SUPER_ECONOMIC: + return fp.selectFee(fees.SuperEconomic, wallet.PRIOIRTY) case wallet.FEE_BUMP: return fp.selectFee(fees.Priority, wallet.PRIOIRTY) default: diff --git a/wallet.go b/wallet.go index 7c10691..6273137 100644 --- a/wallet.go +++ b/wallet.go @@ -98,6 +98,7 @@ func NewSPVWallet(config *Config) (*SPVWallet, error) { config.HighFee, config.MediumFee, config.LowFee, + config.SuperLowFee, config.FeeAPI.String(), config.Proxy, ),