Skip to content

Commit c160783

Browse files
authored
Merge pull request #987 from hieblmi/round-weight
fee: round up transaction weight to the nearest satoshi
2 parents 7c2f676 + 1930be8 commit c160783

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

staticaddr/withdraw/manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ func (m *Manager) createWithdrawalTx(ctx context.Context,
826826
if err != nil {
827827
return nil, 0, 0, err
828828
}
829-
feeWithoutChange := feeRate.FeeForWeight(weight)
829+
feeWithoutChange := feeRate.FeeForWeightRoundUp(weight)
830830

831831
// If the user selected a fraction of the sum of the selected deposits
832832
// to withdraw, check if a change output is needed.
@@ -839,7 +839,7 @@ func (m *Manager) createWithdrawalTx(ctx context.Context,
839839
if err != nil {
840840
return nil, 0, 0, err
841841
}
842-
feeWithChange := feeRate.FeeForWeight(weight)
842+
feeWithChange := feeRate.FeeForWeightRoundUp(weight)
843843

844844
// The available change that can cover fees is the total
845845
// selected deposit amount minus the selected withdrawal amount.

0 commit comments

Comments
 (0)