mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
Merge pull request #2409 from ripcurlx/fix-make-proposal-initialization
Update view on activation with block at current chain height
This commit is contained in:
commit
fc9119bd2b
2 changed files with 14 additions and 1 deletions
|
@ -55,6 +55,7 @@ import bisq.core.dao.governance.proposal.role.RoleProposalFactory;
|
|||
import bisq.core.dao.state.DaoStateListener;
|
||||
import bisq.core.dao.state.DaoStateService;
|
||||
import bisq.core.dao.state.DaoStateStorageService;
|
||||
import bisq.core.dao.state.model.blockchain.Block;
|
||||
import bisq.core.dao.state.model.blockchain.Tx;
|
||||
import bisq.core.dao.state.model.blockchain.TxOutput;
|
||||
import bisq.core.dao.state.model.blockchain.TxOutputKey;
|
||||
|
@ -484,6 +485,14 @@ public class DaoFacade implements DaoSetupService {
|
|||
return daoStateService.getChainHeight();
|
||||
}
|
||||
|
||||
public Optional<Block> getBlockAtChainHeight() {
|
||||
return getBlockAtHeight(getChainHeight());
|
||||
}
|
||||
|
||||
public Optional<Block> getBlockAtHeight(int chainHeight) {
|
||||
return daoStateService.getBlockAtHeight(chainHeight);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Use case: Bonding
|
||||
|
|
|
@ -85,6 +85,7 @@ import javafx.util.StringConverter;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
@ -199,7 +200,10 @@ public class MakeProposalView extends ActivatableView<GridPane, Void> implements
|
|||
if (makeProposalButton != null)
|
||||
setMakeProposalButtonHandler();
|
||||
|
||||
onNewBlockHeight(daoFacade.getChainHeight());
|
||||
Optional<Block> blockAtChainHeight = daoFacade.getBlockAtChainHeight();
|
||||
|
||||
if (blockAtChainHeight.isPresent())
|
||||
onParseTxsCompleteAfterBatchProcessing(blockAtChainHeight.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue