Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Commit

Permalink
Adding some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dangershony committed Jun 6, 2017
1 parent 195beda commit b75ac9d
Show file tree
Hide file tree
Showing 2 changed files with 223 additions and 222 deletions.
6 changes: 4 additions & 2 deletions Stratis.Bitcoin/Wallet/Controllers/WalletController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,11 @@ public IActionResult GetHistory([FromQuery] WalletHistoryRequest request)

var changeAddress = addresses.SingleOrDefault(a => a.IsChangeAddress() && a.Transactions.Any(t => t.Id == transaction.Id));
item.Fee = transaction.Amount.Abs() - item.Amount - (changeAddress == null ? 0 : changeAddress.Transactions.First(t => t.Id == transaction.Id).Amount);
if (item.Fee < 0)
item.Fee = 0;

// generated coins add more coins to the total out
// that makes the fee negative if thats the case ignore the fee
if (item.Fee < 0)
item.Fee = 0;
}

item.Id = transaction.Id;
Expand Down
Loading

0 comments on commit b75ac9d

Please sign in to comment.