itest: allow set fee rate with conf target

In this commit, we add a method in fee service to allow specifying a fee
rate with a conf target.
This commit is contained in:
yyforyongyu 2021-06-04 06:11:57 +08:00
parent 614884dcb8
commit a77225ba9e
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868
2 changed files with 14 additions and 0 deletions

View File

@ -100,3 +100,11 @@ func (f *feeService) setFee(fee chainfee.SatPerKWeight) {
f.Fees[feeServiceTarget] = uint32(fee.FeePerKVByte())
}
// setFeeWithConf sets a fee for the given confirmation target.
func (f *feeService) setFeeWithConf(fee chainfee.SatPerKWeight, conf uint32) {
f.lock.Lock()
defer f.lock.Unlock()
f.Fees[conf] = uint32(fee.FeePerKVByte())
}

View File

@ -1512,6 +1512,12 @@ func (n *NetworkHarness) SetFeeEstimate(fee chainfee.SatPerKWeight) {
n.feeService.setFee(fee)
}
func (n *NetworkHarness) SetFeeEstimateWithConf(
fee chainfee.SatPerKWeight, conf uint32) {
n.feeService.setFeeWithConf(fee, conf)
}
// CopyFile copies the file src to dest.
func CopyFile(dest, src string) error {
s, err := os.Open(src)