Skip to content

Commit

Permalink
Fee deduction fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zgrguric committed Aug 16, 2023
1 parent e459bf4 commit 0751f0b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/TxMutationParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,11 @@ public function __construct(string $reference_account, \stdClass $tx)
foreach($ownBalanceChangesExclFee as $_k => $_o) {
if(count($_o) == 2) {
//is XRP
$_value_xrp = BigDecimal::of($_o['value'])->stripTrailingZeros();
$_value_xrp_without_fee = $_value_xrp->minus($feeBD);
$_value_xrp = BigDecimal::of($_o['value']);
if($_value_xrp->compareTo(0) == 1)
$_value_xrp_without_fee = $_value_xrp->minus($feeBD);
else
$_value_xrp_without_fee = $_value_xrp->plus($feeBD);
if($_value_xrp_without_fee->compareTo(0) == 0) {
//zero, remove
unset($ownBalanceChangesExclFee[$_k]);
Expand Down

0 comments on commit 0751f0b

Please sign in to comment.