Skip to content

Commit

Permalink
Only show accepted bonded roles in bond view.
Browse files Browse the repository at this point in the history
  • Loading branch information
chimp1984 committed Nov 24, 2019
1 parent d12a404 commit ff10f7c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
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 @@ -294,6 +294,10 @@ public ObservableList<BondedRole> getBondedRoles() {
return bondedRolesRepository.getBonds();
}

public List<BondedRole> getAcceptedBondedRoles() {
return bondedRolesRepository.getAcceptedBonds();
}

// Show fee
public Coin getProposalFee(int chainHeight) {
return ProposalConsensus.getFee(daoStateService, chainHeight);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import javax.inject.Inject;

import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -74,6 +75,13 @@ public Optional<RoleProposal> getAcceptedBondedRoleProposal(Role role) {
}


public List<BondedRole> getAcceptedBonds() {
return bonds.stream()
.filter(bondedRole -> getAcceptedBondedRoleProposal(bondedRole.getBondedAsset()).isPresent())
.collect(Collectors.toList());
}


///////////////////////////////////////////////////////////////////////////////////////////
// Protected
///////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected void deactivate() {
///////////////////////////////////////////////////////////////////////////////////////////

private void updateList() {
observableList.setAll(daoFacade.getBondedRoles().stream()
observableList.setAll(daoFacade.getAcceptedBondedRoles().stream()
.map(bond -> new RolesListItem(bond, daoFacade))
.sorted(Comparator.comparing(RolesListItem::getLockupDate).reversed())
.collect(Collectors.toList()));
Expand Down

0 comments on commit ff10f7c

Please sign in to comment.