[bisq-network/bisq] [WIP] Apply rule to not allow BSQ outputs after BTC output for regular txs (#3413)

chimp1984 notifications at github.com
Sun Oct 20 15:14:53 UTC 2019

chimp1984 commented on this pull request.

> +        if (availableInputValue <= 0) {
+            return false;
+        }
+        // Burned BSQ output is last output before opReturn.
+        // We could have also a BSQ change output as last output before opReturn but that will
+        // be detected at blindVoteFee check.
+        // We always have the BSQ change before the burned BSQ output if both are present.
+        checkArgument(optionalOpReturnIndex.isPresent());
+        if (tempTxOutput.getIndex() != optionalOpReturnIndex.get() - 1) {
+            return false;
+        }
+        // Without checking the fee we would not be able to distinguish between 2 structurally same transactions, one
+        // where the output is burned BSQ and one where it is a BSQ change output.
+        long blindVoteFee = daoStateService.getParamValueAsCoin(Param.BLIND_VOTE_FEE, tempTxOutput.getBlockHeight()).value;

There can be an optional BSQ change output.

Inputs [1-n]: BSQ inputs for BSQ fee + stake
Inputs [0-n]: BTC inputs for miner fee
Output [1]: Mandatory BSQ output of stake
Output [0-1] Optional BSQ change output
Outputs [0-1]: BTC change output OR optional burned BSQ as BTC output
Outputs [0-1]: Output [1]: OP_RETURN with OpReturnData and amount 0
Mining fee: BTC mining fee + burned BSQ fee

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191020/9d6bddbe/attachment-0001.html>

More information about the bisq-github mailing list