Skip to content

Commit

Permalink
PaymentProtocol, PaymentSession: remove BIP70 from bitcoinj
Browse files Browse the repository at this point in the history
It had its time, but nowadays nobody is using it any more. Let's
leave it behind.
  • Loading branch information
schildbach committed Feb 27, 2025
1 parent 59ef01c commit b316a50
Show file tree
Hide file tree
Showing 27 changed files with 5 additions and 2,342 deletions.
38 changes: 1 addition & 37 deletions core/src/main/java/org/bitcoinj/core/NetworkParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.bitcoinj.crypto.DumpedPrivateKey;
import org.bitcoinj.params.BitcoinNetworkParams;
import org.bitcoinj.params.Networks;
import org.bitcoinj.protocols.payments.PaymentProtocol;
import org.bitcoinj.script.Script;
import org.bitcoinj.store.BlockStore;
import org.bitcoinj.store.BlockStoreException;
Expand All @@ -50,23 +49,7 @@
* them, you are encouraged to call the static get() methods on each specific params class directly.</p>
*/
public abstract class NetworkParameters {

/** The string used by the payment protocol to represent the main net. */
@Deprecated
public static final String PAYMENT_PROTOCOL_ID_MAINNET = PaymentProtocol.PAYMENT_PROTOCOL_ID_MAINNET;
/** The string used by the payment protocol to represent the test net. */
@Deprecated
public static final String PAYMENT_PROTOCOL_ID_TESTNET = PaymentProtocol.PAYMENT_PROTOCOL_ID_TESTNET;
/** The string used by the payment protocol to represent signet (note that this is non-standard). */
@Deprecated
public static final String PAYMENT_PROTOCOL_ID_SIGNET = PaymentProtocol.PAYMENT_PROTOCOL_ID_SIGNET;
/** The string used by the payment protocol to represent unit testing (note that this is non-standard). */
@Deprecated
public static final String PAYMENT_PROTOCOL_ID_UNIT_TESTS = PaymentProtocol.PAYMENT_PROTOCOL_ID_UNIT_TESTS;
@Deprecated
public static final String PAYMENT_PROTOCOL_ID_REGTEST = PaymentProtocol.PAYMENT_PROTOCOL_ID_REGTEST;

// TODO: Seed nodes should be here as well.
// TODO: Seed nodes should be here as well.

protected BigInteger maxTarget;
protected int port;
Expand Down Expand Up @@ -149,13 +132,6 @@ public Network network() {
return network;
}

/**
* @return the payment protocol network id string
* @deprecated Use {@link PaymentProtocol#protocolIdFromParams(NetworkParameters)}
*/
@Deprecated
public abstract String getPaymentProtocolId();

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down Expand Up @@ -194,18 +170,6 @@ public static NetworkParameters of(Network network) {
: Networks.find(network).orElseThrow(() -> new IllegalArgumentException("Unknown network"));
}

/**
* Return network parameters for a paymentProtocol ID string
* @param pmtProtocolId paymentProtocol ID string
* @return network parameters for the given string paymentProtocolID or NULL if not recognized
* @deprecated Use {@link PaymentProtocol#paramsFromPmtProtocolID(String)} (String)}
*/
@Nullable
@Deprecated
public static NetworkParameters fromPmtProtocolID(String pmtProtocolId) {
return PaymentProtocol.paramsFromPmtProtocolID(pmtProtocolId);
}

public int getSpendableCoinbaseDepth() {
return spendableCoinbaseDepth;
}
Expand Down
109 changes: 0 additions & 109 deletions core/src/main/java/org/bitcoinj/crypto/TrustStoreLoader.java

This file was deleted.

108 changes: 0 additions & 108 deletions core/src/main/java/org/bitcoinj/crypto/X509Utils.java

This file was deleted.

10 changes: 0 additions & 10 deletions core/src/main/java/org/bitcoinj/params/BitcoinNetworkParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.bitcoinj.core.ProtocolVersion;
import org.bitcoinj.core.StoredBlock;
import org.bitcoinj.core.VerificationException;
import org.bitcoinj.protocols.payments.PaymentProtocol;
import org.bitcoinj.store.BlockStore;
import org.bitcoinj.store.BlockStoreException;
import org.bitcoinj.base.utils.MonetaryFormat;
Expand Down Expand Up @@ -117,15 +116,6 @@ public static BitcoinNetworkParams of(BitcoinNetwork network) {
}
}

/**
* @return the payment protocol network id string
* @deprecated Use {@link PaymentProtocol#protocolIdFromParams(NetworkParameters)}
*/
@Deprecated
public String getPaymentProtocolId() {
return PaymentProtocol.protocolIdFromParams(this);
}

/**
* Checks if we are at a reward halving point.
* @param previousHeight The height of the previous stored block
Expand Down
Loading

0 comments on commit b316a50

Please sign in to comment.