Skip to content

Commit

Permalink
Message, TransactionInput, TransactionOutput, TransactionOutPoint, Tr…
Browse files Browse the repository at this point in the history
…ansactionWitness, PartialMerkleTree: remove deprecated method getMessageSize()
  • Loading branch information
schildbach committed Sep 2, 2024
1 parent a1cc811 commit b76f0db
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 76 deletions.
8 changes: 0 additions & 8 deletions core/src/main/java/org/bitcoinj/core/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ public interface Message {
*/
int messageSize();

/**
* @deprecated use {@link #messageSize()}
*/
@Deprecated
default int getMessageSize() {
return messageSize();
}

/**
* Serialize this message to a byte array that conforms to the Bitcoin wire protocol.
*
Expand Down
8 changes: 0 additions & 8 deletions core/src/main/java/org/bitcoinj/core/PartialMerkleTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,6 @@ public int messageSize() {
return size;
}

/**
* @deprecated Use {@link #messageSize()}
*/
@Deprecated
public int getMessageSize() {
return messageSize();
}

// Based on CPartialMerkleTree::TraverseAndBuild in Bitcoin Core.
private static void traverseAndBuild(int height, int pos, List<Sha256Hash> allLeafHashes, byte[] includeBits,
List<Boolean> matchedChildBits, List<Sha256Hash> resultHashes) {
Expand Down
8 changes: 0 additions & 8 deletions core/src/main/java/org/bitcoinj/core/TransactionInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,6 @@ public int messageSize() {
return size;
}

/**
* @deprecated Use {@link #messageSize()}
*/
@Deprecated
public int getMessageSize() {
return messageSize();
}

/**
* Coinbase transactions have special inputs with hashes of zero. If this is such an input, returns true.
*/
Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/org/bitcoinj/core/TransactionOutPoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,6 @@ public byte[] serialize() {
return write(ByteBuffer.allocate(BYTES)).array();
}

/** @deprecated use {@link #BYTES} */
@Deprecated
public int getMessageSize() {
return BYTES;
}

/**
* An outpoint is a part of a transaction input that points to the output of another transaction. If we have both
* sides in memory, and they have been linked together, this returns a pointer to the connected output, or null
Expand Down
8 changes: 0 additions & 8 deletions core/src/main/java/org/bitcoinj/core/TransactionOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,6 @@ public int messageSize() {
return size;
}

/**
* @deprecated Use {@link #messageSize()}
*/
@Deprecated
public int getMessageSize() {
return messageSize();
}

/**
* Returns the value of this output. This is the amount of currency that the destination address
* receives.
Expand Down
8 changes: 0 additions & 8 deletions core/src/main/java/org/bitcoinj/core/TransactionWitness.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,6 @@ public int messageSize() {
return size;
}

/**
* @deprecated Use {@link #messageSize()}
*/
@Deprecated
public int getMessageSize() {
return messageSize();
}

@Override
public String toString() {
List<String> stringPushes = new ArrayList<>(pushes.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1233,9 +1233,9 @@ public boolean add(Rule element) {
checkState(stream.size() == b64Original.block.messageSize() + 8);
// This check fails because it was created for "retain mode" and the likely encoding is not "optimal".
// We since removed this capability retain the original encoding, but could not rewrite this test data.
// checkState(stream.size() == b64.getMessageSize());
// checkState(stream.size() == b64.messageSize());
// checkState(Arrays.equals(stream.toByteArray(), b64.serialize()));
// checkState(b64.getOptimalEncodingMessageSize() == b64Original.block.getMessageSize());
// checkState(b64.getOptimalEncodingMessageSize() == b64Original.block.messageSize());
}
blocks.add(new BlockAndValidity(b64, true, false, b64.getHash(), chainHeadHeight + 19, "b64"));
spendableOutputs.offer(b64Original.getCoinbaseOutput());
Expand Down
27 changes: 0 additions & 27 deletions core/src/test/java/org/bitcoinj/core/MessageTest.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ private Iterator<TransactionOutPoint> randomOutPoints() {
public void deprecatedMembers() {
TransactionOutPoint outpoint = TransactionOutPoint.UNCONNECTED;
outpoint.getHash();
outpoint.getMessageSize();
outpoint.getIndex();
}
}

0 comments on commit b76f0db

Please sign in to comment.