Skip to content
This repository was archived by the owner on Aug 23, 2020. It is now read-only.

Commit

Permalink
Fix: Fixes regression introduced through the bundle validator refactor (
Browse files Browse the repository at this point in the history
#1588)

* removes redundant break statement

* remove redundant check whether first tx of bndl equals current tvm
  • Loading branch information
luca-moser authored and Gal Rogozinski committed Sep 2, 2019
1 parent 6769054 commit b248dbd
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,20 +205,16 @@ public Map<Hash, Long> generateBalanceDiff(Set<Hash> visitedTransactions, Hash s
break;
}

if (bundleTransactions.get(0).getHash().equals(transactionViewModel.getHash())) {

for (final TransactionViewModel bundleTransactionViewModel : bundleTransactions) {
for (final TransactionViewModel bundleTransactionViewModel : bundleTransactions) {

if (bundleTransactionViewModel.value() != 0 && countedTx.add(bundleTransactionViewModel.getHash())) {
if (bundleTransactionViewModel.value() != 0 && countedTx.add(bundleTransactionViewModel.getHash())) {

final Hash address = bundleTransactionViewModel.getAddressHash();
final Long value = state.get(address);
state.put(address, value == null ? bundleTransactionViewModel.value()
: Math.addExact(value, bundleTransactionViewModel.value()));
}
final Hash address = bundleTransactionViewModel.getAddressHash();
final Long value = state.get(address);
state.put(address, value == null ? bundleTransactionViewModel.value()
: Math.addExact(value, bundleTransactionViewModel.value()));
}

break;
}
}

Expand Down

0 comments on commit b248dbd

Please sign in to comment.