[bisq-network/bisq] Added mining fee to un/lock bond popup. (#2541)

Manfred Karrer notifications at github.com
Fri Mar 15 23:47:14 UTC 2019


ManfredKarrer commented on this pull request.



> @@ -147,13 +162,18 @@ public void unLock(String lockupTxId, Consumer<String> resultHandler) {
 
             try {
                 if (!DevEnv.isDevMode()) {
+                    Tuple2<Coin, Integer> miningFeeAndTxSize = daoFacade.getMiningFeeAndTxSize(unlockAmount);
+                    Coin miningFee = miningFeeAndTxSize.first;

Unfortunately daoFacade.getMiningFeeAndTxSize is not correctly named. It is only valid for the blind vote tx (I will rename the method in another commit). We need to use the correct tx which will be created at the unlock tx (without triggering any side effects as the user can cancel).

> @@ -101,18 +105,29 @@ private void lockupBond(byte[] hash, Coin lockupAmount, int lockupTime, LockupRe
                             Consumer<String> resultHandler) {
         if (GUIUtil.isReadyForTxBroadcast(p2PService, walletsSetup)) {
             if (!DevEnv.isDevMode()) {
-                BSFormatter formatter = new BSFormatter();
-                String duration = formatter.formatDurationAsWords(lockupTime * 10 * 60 * 1000L, false, false);
-                new Popup<>().headLine(Res.get("dao.bond.reputation.lockup.headline"))
-                        .confirmation(Res.get("dao.bond.reputation.lockup.details",
-                                bsqFormatter.formatCoinWithCode(lockupAmount),
-                                lockupTime,
-                                duration
-                        ))
-                        .actionButtonText(Res.get("shared.yes"))
-                        .onAction(() -> publishLockupTx(hash, lockupAmount, lockupTime, lockupReason, resultHandler))
-                        .closeButtonText(Res.get("shared.cancel"))
-                        .show();
+                try {
+                    Tuple2<Coin, Integer> miningFeeAndTxSize = daoFacade.getMiningFeeAndTxSize(lockupAmount);
+                    Coin miningFee = miningFeeAndTxSize.first;

Unfortunately daoFacade.getMiningFeeAndTxSize is not correctly named. It is only valid for the blind vote tx (I will rename the method in another commit). We need to use the correct tx which will be created at the lockup (without triggering any side effects as the user can cancel).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/2541#pullrequestreview-215286133
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190315/c23c66a1/attachment-0001.html>


More information about the bisq-github mailing list