Skip to content

Commit

Permalink
Add number of irregular txs to UI
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer committed Mar 31, 2019
1 parent 4d56ce9 commit e9e4b49
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/bisq/core/dao/DaoFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,10 @@ public List<Tx> getInvalidTxs() {
return daoStateService.getInvalidTxs();
}

public List<Tx> getIrregularTxs() {
return daoStateService.getIrregularTxs();
}

public long getTotalAmountOfUnspentTxOutputs() {
// Does not consider confiscated outputs (they stay as utxo)
return daoStateService.getUnspentTxOutputMap().values().stream().mapToLong(BaseTxOutput::getValue).sum();
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/java/bisq/core/dao/state/DaoStateService.java
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ public List<Tx> getInvalidTxs() {
return getTxStream().filter(tx -> tx.getTxType() == TxType.INVALID).collect(Collectors.toList());
}

public List<Tx> getIrregularTxs() {
return getTxStream().filter(tx -> tx.getTxType() == TxType.IRREGULAR).collect(Collectors.toList());
}

public boolean containsTx(String txId) {
return getTx(txId).isPresent();
}
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,7 @@ dao.factsAndFigures.transactions.compensationIssuanceTx=No. of all compensation
dao.factsAndFigures.transactions.reimbursementIssuanceTx=No. of all reimbursement request issuance transactions
dao.factsAndFigures.transactions.burntTx=No. of all fee payments transactions
dao.factsAndFigures.transactions.invalidTx=No. of all invalid transactions
dao.factsAndFigures.transactions.irregularTx=No. of all irregular transactions

####################################################################
# Windows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public class BSQTransactionsView extends ActivatableView<GridPane, Void> impleme
private int gridRow = 0;
private TextField allTxTextField, burntFeeTxsTextField,
utxoTextField, compensationIssuanceTxTextField,
reimbursementIssuanceTxTextField,
invalidTxsTextField;
reimbursementIssuanceTxTextField, invalidTxsTextField, irregularTxsTextField;

///////////////////////////////////////////////////////////////////////////////////////////
// Constructor, lifecycle
Expand Down Expand Up @@ -96,21 +95,24 @@ public void initialize() {
utxoTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.factsAndFigures.transactions.utxo")).second;
compensationIssuanceTxTextField = addTopLabelReadOnlyTextField(root, ++gridRow,
Res.get("dao.factsAndFigures.transactions.compensationIssuanceTx")).second;
reimbursementIssuanceTxTextField = addTopLabelReadOnlyTextField(root, ++gridRow,
Res.get("dao.factsAndFigures.transactions.reimbursementIssuanceTx")).second;

int columnIndex = 1;

gridRow = startRow;

titledGroupBg = addTitledGroupBg(root, startRow, columnIndex, 3, "", Layout.GROUP_DISTANCE);
titledGroupBg.getStyleClass().add("last");

reimbursementIssuanceTxTextField = addTopLabelReadOnlyTextField(root, gridRow, columnIndex,
Res.get("dao.factsAndFigures.transactions.reimbursementIssuanceTx"),
burntFeeTxsTextField = addTopLabelReadOnlyTextField(root, gridRow, columnIndex,
Res.get("dao.factsAndFigures.transactions.burntTx"),
Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
burntFeeTxsTextField = addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex,
Res.get("dao.factsAndFigures.transactions.burntTx")).second;
invalidTxsTextField = addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex,
Res.get("dao.factsAndFigures.transactions.invalidTx")).second;
irregularTxsTextField = addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex,
Res.get("dao.factsAndFigures.transactions.irregularTx")).second;
gridRow++;

}

@Override
Expand Down Expand Up @@ -147,6 +149,7 @@ private void updateWithBsqBlockChainData() {
reimbursementIssuanceTxTextField.setText(String.valueOf(daoFacade.getNumIssuanceTransactions(IssuanceType.REIMBURSEMENT)));
burntFeeTxsTextField.setText(String.valueOf(daoFacade.getBurntFeeTxs().size()));
invalidTxsTextField.setText(String.valueOf(daoFacade.getInvalidTxs().size()));
irregularTxsTextField.setText(String.valueOf(daoFacade.getIrregularTxs().size()));
}
}

0 comments on commit e9e4b49

Please sign in to comment.