Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Only increment the added transaction counter if we actually added the transaction #1543

Merged
merged 3 commits into from
Jun 10, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,20 @@ List<Transaction> getLocalTransactions() {
public boolean addRemoteTransaction(final Transaction transaction) {
final TransactionInfo transactionInfo =
new TransactionInfo(transaction, false, clock.instant());
final boolean addTransaction = addTransaction(transactionInfo);
remoteTransactionAddedCounter.inc();
return addTransaction;
final boolean transactionAdded = addTransaction(transactionInfo);
if (transactionAdded) {
remoteTransactionAddedCounter.inc();
}
return transactionAdded;
}

boolean addLocalTransaction(final Transaction transaction) {
final boolean addTransaction =
final boolean transactionAdded =
addTransaction(new TransactionInfo(transaction, true, clock.instant()));
localTransactionAddedCounter.inc();
return addTransaction;
if (transactionAdded) {
localTransactionAddedCounter.inc();
}
return transactionAdded;
}

void removeTransaction(final Transaction transaction) {
Expand Down