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

sqrrm notifications at github.com
Sat Mar 30 15:15:10 UTC 2019


sqrrm commented on this pull request.



> @@ -219,12 +222,14 @@ private void publishToAppendOnlyDataStore() {
                 .filter(proposal -> validatorProvider.getValidator(proposal).isValidAndConfirmed(proposal))
                 .map(ProposalPayload::new)
                 .forEach(proposalPayload -> {
-                    boolean success = p2PService.addPersistableNetworkPayload(proposalPayload, true);
-                    if (success)
-                        log.info("We published a ProposalPayload to the P2P network as append-only data. proposalTxId={}",
-                                proposalPayload.getProposal().getTxId());
-                    else
-                        log.warn("publishToAppendOnlyDataStore failed for proposal " + proposalPayload.getProposal());
+                    UserThread.runAfterRandomDelay(() -> {
+                        boolean success = p2PService.addPersistableNetworkPayload(proposalPayload, true);
+                        if (success)
+                            log.info("We published a ProposalPayload to the P2P network as append-only data. proposalTxId={}",
+                                    proposalPayload.getProposal().getTxId());
+                        else
+                            log.warn("publishToAppendOnlyDataStore failed for proposal " + proposalPayload.getProposal());
+                    }, 100, 5000, TimeUnit.MILLISECONDS);

There are a lot of clients and they will all be sending the same data more or less so it's not dependent on one single instance. If you think that's not as safe I'm ok with the 5s interval as well.

-- 
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_r270629806
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190330/9948a9ba/attachment.html>


More information about the bisq-github mailing list