[bisq-network/bisq] Add donation address check for open trades (#4135)

sqrrm notifications at github.com
Wed Apr 8 01:19:34 UTC 2020


@sqrrm commented on this pull request.



> +
+        // Get most recent donation address.
+        // We do not support past DAO param addresses to avoid that those receive funds (no bond set up anymore).
+        // Users who have not synced the DAO cannot trade.
+        String recentDonationAddressString = daoFacade.getParamValue(Param.RECIPIENT_BTC_ADDRESS);
+
+        // In case the seller has deactivated the DAO the default address will be used.
+        String defaultDonationAddressString = Param.RECIPIENT_BTC_ADDRESS.getDefaultValue();
+
+        TransactionOutput output = delayedPayoutTx.getOutput(0);
+        NetworkParameters params = btcWalletService.getParams();
+        Address address = output.getAddressFromP2PKHScript(params);
+        if (address == null) {
+            // The donation address can be as well be a multisig address.
+            address = output.getAddressFromP2SH(params);
+            checkNotNull(address, "address must not be null");

If you ever had a malformed tx you wouldn't be able to start up. In general I think it should work.

-- 
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/4135#discussion_r405204052
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200407/dd96f652/attachment-0001.html>


More information about the bisq-github mailing list