[bisq-network/bisq] Add irregular txType, add check for total balance, prevent proposal withhold attack (#2587)

Manfred Karrer notifications at github.com
Sat Mar 30 21:34:37 UTC 2019


ManfredKarrer commented on this pull request.



> @@ -811,6 +816,27 @@ public long getTotalAmountOfConfiscatedTxOutputs() {
                 .sum();
     }
 
+    public long getBurnedBsqOfAllInvalidTxs() {
+        return getTxStream()
+                .filter(e -> e.getTxType() == TxType.INVALID)
+                .mapToLong(this::getBurnedBsqOfInvalidTx)
+                .sum();
+    }
+
+    public long getBurnedBsqOfInvalidTx(Tx tx) {

Ah ok. I am not sure if it is valid for normal txs as well as all special cases handled in the input parser are ignored here. It only checks the txoutput types. I think for the use case of invalid txs that should be good enough. A maybe more safe approach would be to add another field to tx like burnedFee for the burned BSQ from an invalid tx. Only at parse time we have all checks done and we could not do that later as well. Hm... not sure if its worth to add that field but might be more safe. In fact we need to add a comment to that method that this is not intended to be used otherwise as it is not a perfect check....

-- 
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/2587#discussion_r270642668
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190330/359f3a7a/attachment.html>


More information about the bisq-github mailing list