mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-20 10:22:18 +01:00
Cleanup blind vote domain
This commit is contained in:
parent
24991d739a
commit
21be6bec81
@ -58,7 +58,6 @@ import bisq.common.util.Tuple3;
|
|||||||
|
|
||||||
import org.bitcoinj.core.Coin;
|
import org.bitcoinj.core.Coin;
|
||||||
import org.bitcoinj.core.InsufficientMoneyException;
|
import org.bitcoinj.core.InsufficientMoneyException;
|
||||||
import org.bitcoinj.core.Transaction;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -476,20 +475,16 @@ public class ProposalsView extends ActivatableView<GridPane, Void> implements Bs
|
|||||||
private void onVote() {
|
private void onVote() {
|
||||||
// TODO verify stake
|
// TODO verify stake
|
||||||
Coin stake = bsqFormatter.parseToCoin(stakeInputTextField.getText());
|
Coin stake = bsqFormatter.parseToCoin(stakeInputTextField.getText());
|
||||||
final Coin blindVoteFee = daoFacade.getBlindVoteFeeForCycle();
|
|
||||||
Transaction dummyTx = null;
|
|
||||||
try {
|
try {
|
||||||
// We create a dummy tx to get the mining blindVoteFee for confirmation popup
|
// We create a dummy tx to get the miningFee for displaying it at the confirmation popup
|
||||||
dummyTx = daoFacade.getDummyBlindVoteTx(stake, blindVoteFee);
|
Tuple2<Coin, Integer> miningFeeAndTxSize = daoFacade.getMiningFeeAndTxSize(stake);
|
||||||
} catch (InsufficientMoneyException | WalletException | TransactionVerificationException exception) {
|
Coin miningFee = miningFeeAndTxSize.first;
|
||||||
new Popup<>().warning(exception.toString()).show();
|
int txSize = miningFeeAndTxSize.second;
|
||||||
}
|
Coin blindVoteFee = daoFacade.getBlindVoteFeeForCycle();
|
||||||
|
|
||||||
if (dummyTx != null) {
|
|
||||||
Coin miningFee = dummyTx.getFee();
|
|
||||||
int txSize = dummyTx.bitcoinSerialize().length;
|
|
||||||
GUIUtil.showBsqFeeInfoPopup(blindVoteFee, miningFee, txSize, bsqFormatter, btcFormatter,
|
GUIUtil.showBsqFeeInfoPopup(blindVoteFee, miningFee, txSize, bsqFormatter, btcFormatter,
|
||||||
Res.get("dao.blindVote"), () -> publishBlindVote(stake));
|
Res.get("dao.blindVote"), () -> publishBlindVote(stake));
|
||||||
|
} catch (InsufficientMoneyException | WalletException | TransactionVerificationException exception) {
|
||||||
|
new Popup<>().warning(exception.toString()).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user