mirror of
https://github.com/bisq-network/bisq.git
synced 2025-01-19 05:44:05 +01:00
Only show accepted bonded roles in bond view.
Fixes #3271 Replaces https://github.com/bisq-network/bisq/pull/3320
This commit is contained in:
parent
d12a4049ad
commit
ff10f7cf3f
@ -294,6 +294,10 @@ public class DaoFacade implements DaoSetupService {
|
||||
return bondedRolesRepository.getBonds();
|
||||
}
|
||||
|
||||
public List<BondedRole> getAcceptedBondedRoles() {
|
||||
return bondedRolesRepository.getAcceptedBonds();
|
||||
}
|
||||
|
||||
// Show fee
|
||||
public Coin getProposalFee(int chainHeight) {
|
||||
return ProposalConsensus.getFee(daoStateService, chainHeight);
|
||||
|
@ -32,6 +32,7 @@ import org.bitcoinj.core.Transaction;
|
||||
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;
|
||||
@ -74,6 +75,13 @@ public class BondedRolesRepository extends BondRepository<BondedRole, Role> {
|
||||
}
|
||||
|
||||
|
||||
public List<BondedRole> getAcceptedBonds() {
|
||||
return bonds.stream()
|
||||
.filter(bondedRole -> getAcceptedBondedRoleProposal(bondedRole.getBondedAsset()).isPresent())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Protected
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -120,7 +120,7 @@ public class RolesView extends ActivatableView<GridPane, Void> {
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
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()));
|
||||
|
Loading…
Reference in New Issue
Block a user