diff --git a/core/src/main/java/bisq/core/btc/wallet/http/MemPoolSpaceTxBroadcaster.java b/core/src/main/java/bisq/core/btc/wallet/http/MemPoolSpaceTxBroadcaster.java index 921b7718903..ab116273648 100644 --- a/core/src/main/java/bisq/core/btc/wallet/http/MemPoolSpaceTxBroadcaster.java +++ b/core/src/main/java/bisq/core/btc/wallet/http/MemPoolSpaceTxBroadcaster.java @@ -17,6 +17,7 @@ package bisq.core.btc.wallet.http; +import bisq.core.btc.nodes.LocalBitcoinNode; import bisq.core.user.Preferences; import bisq.network.Socks5ProxyProvider; @@ -50,13 +51,16 @@ public class MemPoolSpaceTxBroadcaster { private static Socks5ProxyProvider socks5ProxyProvider; private static Preferences preferences; + private static LocalBitcoinNode localBitcoinNode; private static final ListeningExecutorService executorService = Utilities.getListeningExecutorService( "MemPoolSpaceTxBroadcaster", 3, 5, 10 * 60); public static void init(Socks5ProxyProvider socks5ProxyProvider, - Preferences preferences) { + Preferences preferences, + LocalBitcoinNode localBitcoinNode) { MemPoolSpaceTxBroadcaster.socks5ProxyProvider = socks5ProxyProvider; MemPoolSpaceTxBroadcaster.preferences = preferences; + MemPoolSpaceTxBroadcaster.localBitcoinNode = localBitcoinNode; } public static void broadcastTx(Transaction tx) { @@ -65,6 +69,12 @@ public static void broadcastTx(Transaction tx) { return; } + if (localBitcoinNode.shouldBeUsed()) { + log.info("A localBitcoinNode is detected and used. For privacy reasons we do not use the tx " + + "broadcast to mempool nodes in that case."); + return; + } + if (socks5ProxyProvider == null) { log.warn("We got broadcastTx called before init was called."); return;