multi: make sure CPFP won't exceed max allowed fee rate

This commit updates the `fee()` method in `weightEstimator` to make sure
when doing CPFP we are not exceeding the max allowed fee rate. In order
to use the max fee rate, we need to modify several methods to pass the
configured value to the estimator.
This commit is contained in:
yyforyongyu
2023-08-22 11:06:51 +08:00
committed by Olaoluwa Osuntokun
parent 42ff52bbfb
commit 24fa35ec80
12 changed files with 132 additions and 48 deletions

View File

@@ -297,7 +297,7 @@ func TestCraftSweepAllTxCoinSelectFail(t *testing.T) {
utxoLocker := newMockOutpointLocker()
_, err := CraftSweepAllTx(
0, 10, nil, nil, coinSelectLocker, utxoSource, utxoLocker, nil,
0, 0, 10, nil, nil, coinSelectLocker, utxoSource, utxoLocker, nil,
nil, 0,
)
@@ -323,7 +323,7 @@ func TestCraftSweepAllTxUnknownWitnessType(t *testing.T) {
utxoLocker := newMockOutpointLocker()
_, err := CraftSweepAllTx(
0, 10, nil, nil, coinSelectLocker, utxoSource, utxoLocker, nil,
0, 0, 10, nil, nil, coinSelectLocker, utxoSource, utxoLocker, nil,
nil, 0,
)
@@ -358,7 +358,7 @@ func TestCraftSweepAllTx(t *testing.T) {
utxoLocker := newMockOutpointLocker()
sweepPkg, err := CraftSweepAllTx(
0, 10, nil, deliveryAddr, coinSelectLocker, utxoSource,
0, 0, 10, nil, deliveryAddr, coinSelectLocker, utxoSource,
utxoLocker, feeEstimator, signer, 0,
)
require.NoError(t, err, "unable to make sweep tx")