diff --git a/core/src/main/java/bisq/core/dao/governance/asset/AssetService.java b/core/src/main/java/bisq/core/dao/governance/asset/AssetService.java index a0b9e9267ac..f2bad0f804d 100644 --- a/core/src/main/java/bisq/core/dao/governance/asset/AssetService.java +++ b/core/src/main/java/bisq/core/dao/governance/asset/AssetService.java @@ -33,6 +33,7 @@ import bisq.core.dao.state.model.blockchain.Block; import bisq.core.dao.state.model.blockchain.Tx; import bisq.core.dao.state.model.blockchain.TxType; +import bisq.core.dao.state.model.governance.EvaluatedProposal; import bisq.core.dao.state.model.governance.RemoveAssetProposal; import bisq.core.locale.CurrencyUtil; import bisq.core.trade.statistics.TradeStatistics2; @@ -286,7 +287,7 @@ public void onParseBlockCompleteAfterBatchProcessing(Block block) { /////////////////////////////////////////////////////////////////////////////////////////// public boolean wasAssetRemovedByVoting(String tickerSymbol) { - boolean isRemoved = getRemoveAssetProposalStream() + boolean isRemoved = getAcceptedRemoveAssetProposalStream() .anyMatch(proposal -> proposal.getTickerSymbol().equals(tickerSymbol)); if (isRemoved) log.info("Asset '{}' was removed", CurrencyUtil.getNameAndCode(tickerSymbol)); @@ -306,9 +307,10 @@ private Optional findAsset(String tickerSymbol) { // Private /////////////////////////////////////////////////////////////////////////////////////////// - private Stream getRemoveAssetProposalStream() { + private Stream getAcceptedRemoveAssetProposalStream() { return daoStateService.getEvaluatedProposalList().stream() .filter(evaluatedProposal -> evaluatedProposal.getProposal() instanceof RemoveAssetProposal) + .filter(EvaluatedProposal::isAccepted) .map(e -> ((RemoveAssetProposal) e.getProposal())); } diff --git a/core/src/main/java/bisq/core/dao/governance/bond/role/BondedRolesRepository.java b/core/src/main/java/bisq/core/dao/governance/bond/role/BondedRolesRepository.java index 21aab0b53fd..2ca3b479c9d 100644 --- a/core/src/main/java/bisq/core/dao/governance/bond/role/BondedRolesRepository.java +++ b/core/src/main/java/bisq/core/dao/governance/bond/role/BondedRolesRepository.java @@ -22,6 +22,7 @@ import bisq.core.dao.governance.bond.BondRepository; import bisq.core.dao.state.DaoStateService; import bisq.core.dao.state.model.blockchain.TxOutput; +import bisq.core.dao.state.model.governance.EvaluatedProposal; import bisq.core.dao.state.model.governance.Proposal; import bisq.core.dao.state.model.governance.Role; import bisq.core.dao.state.model.governance.RoleProposal; @@ -62,7 +63,7 @@ public boolean isMyRole(Role role) { Set myWalletTransactionIds = bsqWalletService.getWalletTransactions().stream() .map(Transaction::getHashAsString) .collect(Collectors.toSet()); - return getBondedRoleProposalStream() + return getAcceptedBondedRoleProposalStream() .filter(roleProposal -> roleProposal.getRole().equals(role)) .map(Proposal::getTxId) .anyMatch(myWalletTransactionIds::contains); @@ -109,4 +110,11 @@ private Stream getBondedRoleProposalStream() { .filter(evaluatedProposal -> evaluatedProposal.getProposal() instanceof RoleProposal) .map(e -> ((RoleProposal) e.getProposal())); } + + private Stream getAcceptedBondedRoleProposalStream() { + return daoStateService.getEvaluatedProposalList().stream() + .filter(evaluatedProposal -> evaluatedProposal.getProposal() instanceof RoleProposal) + .filter(EvaluatedProposal::isAccepted) + .map(e -> ((RoleProposal) e.getProposal())); + } }