Skip to content

Commit

Permalink
Add indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
julia-zack committed Aug 28, 2023
1 parent c7f06dd commit 575c758
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/co/rsk/bitcoinj/wallet/Wallet.java
Original file line number Diff line number Diff line change
Expand Up @@ -931,14 +931,14 @@ public FeeCalculation calculateFee(SendRequest req, Coin value, List<Transaction
}
for (int i = 0; i < req.tx.getOutputs().size(); i++) {
TransactionOutput output = new TransactionOutput(params, tx,
req.tx.getOutputs().get(i).bitcoinSerialize(), 0);
req.tx.getOutputs().get(i).bitcoinSerialize(), 0);
if (req.recipientsPayFees) {
// Subtract fee equally from each selected recipient
output.setValue(output.getValue().subtract(fee.divide(req.tx.getOutputs().size())));
// first receiver pays the remainder not divisible by output count
if (i == 0) {
output.setValue(
output.getValue().subtract(fee.divideAndRemainder(req.tx.getOutputs().size())[1])); // Subtract fee equally from each selected recipient
output.getValue().subtract(fee.divideAndRemainder(req.tx.getOutputs().size())[1])); // Subtract fee equally from each selected recipient
}
result.updatedOutputValues.add(output.getValue());
if (output.getMinNonDustValue().isGreaterThan(output.getValue())) {
Expand Down

0 comments on commit 575c758

Please sign in to comment.