lnwallet+sweep: introduce TxPublisher to handle fee bump

This commit adds `TxPublisher` which implements `Bumper` interface. This
is part one of the implementation that focuses on implementing the
`Broadcast` method which guarantees a tx can be published with
RBF-compliant. It does so by leveraging the `testmempoolaccept` API,
keep increasing the fee rate until an RBF-compliant tx is made and
broadcasts it.

This tx will then be monitored by the `TxPublisher` and in the following
commit, the monitoring process will be added.
This commit is contained in:
yyforyongyu
2024-02-29 13:18:59 +08:00
parent ecd471ac75
commit 11f7e455d1
6 changed files with 1548 additions and 5 deletions

View File

@@ -205,15 +205,14 @@ func createSweepTx(inputs []input.Input, outputs []*wire.TxOut,
}
}
log.Infof("Creating sweep transaction %v for %v inputs (%s) "+
"using %v sat/kw, tx_weight=%v, tx_fee=%v, parents_count=%v, "+
"parents_fee=%v, parents_weight=%v",
log.Debugf("Creating sweep transaction %v for %v inputs (%s) "+
"using %v, tx_weight=%v, tx_fee=%v, parents_count=%v, "+
"parents_fee=%v, parents_weight=%v, current_height=%v",
sweepTx.TxHash(), len(inputs),
inputTypeSummary(inputs), feeRate,
estimator.weight(), txFee,
len(estimator.parents), estimator.parentsFee,
estimator.parentsWeight,
)
estimator.parentsWeight, currentBlockHeight)
return sweepTx, txFee, nil
}