[bisq-network/bisq] Prevent dust outputs from being created during the trade process (#4094)

James Cox notifications at github.com
Fri Mar 27 02:56:32 UTC 2020


@jmacxx commented on this pull request.



> @@ -1216,4 +1219,25 @@ private void applyLockTime(long lockTime, Transaction tx) {
         tx.getInputs().forEach(input -> input.setSequenceNumber(TransactionInput.NO_SEQUENCE - 1));
         tx.setLockTime(lockTime);
     }
+
+    private boolean removeDust(Transaction tx) {
+        List<TransactionOutput> txos = tx.getOutputs();
+        List<TransactionOutput> toKeep = new ArrayList<TransactionOutput>();
+        for (TransactionOutput zz: txos) {
+            if (zz.getValue().value >= 546) {
+                toKeep.add(zz);
+            }
+            else {
+                log.info("removing dust TXO = {}", zz.getValue().toFriendlyString());

Thankyou for the review!  I have made the changes you suggested.  Here is an example of the more verbose logging as a result of this change:

![image](https://user-images.githubusercontent.com/47253594/77716425-2be97680-6fac-11ea-817b-81b3cc4b6fe2.png)


-- 
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/4094#discussion_r399007955
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200326/7bb7f49f/attachment-0001.html>


More information about the bisq-github mailing list