Skip to content

Commit 1930be8

Browse files
committed
staticaddr: round up withdrawal tx weight to the nearest satoshi
this commit fixes issue #966
1 parent 7c2f676 commit 1930be8

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)