Skip to content

Commit

Permalink
Merge pull request #49 from Staketab/dev
Browse files Browse the repository at this point in the history
fix bug with remove tx with null amount
  • Loading branch information
MrFoxogen authored Apr 30, 2024
2 parents cc3dc98 + 000ae4c commit f0a0694
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public interface PayableTransactionRepository extends JpaRepository<PayableTrans

List<PayableTransactionEntity> findAllByTxStatus(TxStatus txStatus);

List<PayableTransactionEntity> findAllByTxStatusAndTxAmountIsNotNull(TxStatus txStatus);

@Modifying
void deleteAllByTxHashIn(Collection<String> txHash);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void checkTransactions() {
@Override
@Transactional
public void deleteTxsWithIncorrectAmount() {
List<PayableTransactionEntity> pendingTxs = payableTransactionRepository.findAllByTxStatus(TxStatus.PENDING);
List<PayableTransactionEntity> pendingTxs = payableTransactionRepository.findAllByTxStatusAndTxAmountIsNotNull(TxStatus.PENDING);
List<PayableTransactionEntity> correctAppliedTxs = txsWithIncorrectAmount(pendingTxs);
pendingTxs.retainAll(correctAppliedTxs);
saveLogInfo(pendingTxs, INCORRECT_AMOUNT);
Expand Down

0 comments on commit f0a0694

Please sign in to comment.