add mempool.emzy.de as another broadcaster

This commit is contained in:
Craig Raw 2021-05-20 14:48:01 +02:00
parent 383594b03c
commit c202a941b9

View file

@ -40,6 +40,22 @@ public enum BroadcastSource {
return postTransactionData(data); return postTransactionData(data);
} }
protected URL getURL(Proxy proxy) throws MalformedURLException {
if(Network.get() == Network.MAINNET) {
return new URL(getBaseUrl(proxy) + "/api/tx");
} else if(Network.get() == Network.TESTNET) {
return new URL(getBaseUrl(proxy) + "/testnet/api/tx");
} else {
throw new IllegalStateException("Cannot broadcast transaction to " + getName() + " on network " + Network.get());
}
}
},
MEMPOOL_EMZY_DE("mempool.emzy.de", "https://mempool.emzy.de", "http://mempool4t6mypeemozyterviq3i5de4kpoua65r3qkn5i3kknu5l2cad.onion") {
public Sha256Hash broadcastTransaction(Transaction transaction) throws BroadcastException {
String data = Utils.bytesToHex(transaction.bitcoinSerialize());
return postTransactionData(data);
}
protected URL getURL(Proxy proxy) throws MalformedURLException { protected URL getURL(Proxy proxy) throws MalformedURLException {
if(Network.get() == Network.MAINNET) { if(Network.get() == Network.MAINNET) {
return new URL(getBaseUrl(proxy) + "/api/tx"); return new URL(getBaseUrl(proxy) + "/api/tx");