mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-26 21:51:27 +02:00
walletrpc+sweep: refactor BumpFee
to properly handle sweep request
This commit is contained in:
@@ -490,12 +490,12 @@ func (t *TxPublisher) createAndCheckTx(req *BumpRequest, f FeeFunction) (
|
||||
req.Inputs, req.DeliveryAddress, f.FeeRate(),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, 0, fmt.Errorf("create sweep tx: %w", err)
|
||||
return nil, fee, fmt.Errorf("create sweep tx: %w", err)
|
||||
}
|
||||
|
||||
// Sanity check the budget still covers the fee.
|
||||
if fee > req.Budget {
|
||||
return nil, 0, fmt.Errorf("%w: budget=%v, fee=%v",
|
||||
return nil, fee, fmt.Errorf("%w: budget=%v, fee=%v",
|
||||
ErrNotEnoughBudget, req.Budget, fee)
|
||||
}
|
||||
|
||||
@@ -522,8 +522,8 @@ func (t *TxPublisher) createAndCheckTx(req *BumpRequest, f FeeFunction) (
|
||||
return tx, fee, nil
|
||||
}
|
||||
|
||||
return nil, 0, fmt.Errorf("tx=%v failed mempool check: %w", tx.TxHash(),
|
||||
err)
|
||||
return nil, fee, fmt.Errorf("tx=%v failed mempool check: %w",
|
||||
tx.TxHash(), err)
|
||||
}
|
||||
|
||||
// broadcast takes a monitored tx and publishes it to the network. Prior to the
|
||||
|
Reference in New Issue
Block a user