TransactionInput: remove helper duplicateDetached()

It is only used from a test, and that test works just as well by
just copying the reference.
This commit is contained in:
Andreas Schildbach 2023-03-31 10:34:56 +02:00
parent 81adac9f1e
commit a3f82d6bae
2 changed files with 1 additions and 6 deletions

View file

@ -496,11 +496,6 @@ public class TransactionInput extends Message {
return getOutpoint().fromTx; return getOutpoint().fromTx;
} }
/** Returns a copy of the input detached from its containing transaction, if need be. */
public TransactionInput duplicateDetached() {
return new TransactionInput(null, ByteBuffer.wrap(bitcoinSerialize()));
}
/** /**
* <p>Returns either RuleViolation.NONE if the input is standard, or which rule makes it non-standard if so. * <p>Returns either RuleViolation.NONE if the input is standard, or which rule makes it non-standard if so.
* The "IsStandard" rules control whether the default Bitcoin Core client blocks relay of a tx / refuses to mine it, * The "IsStandard" rules control whether the default Bitcoin Core client blocks relay of a tx / refuses to mine it,

View file

@ -107,7 +107,7 @@ public class TransactionTest {
public void duplicateOutPoint() { public void duplicateOutPoint() {
TransactionInput input = tx.getInput(0); TransactionInput input = tx.getInput(0);
input.setScriptBytes(new byte[1]); input.setScriptBytes(new byte[1]);
tx.addInput(input.duplicateDetached()); tx.addInput(input);
tx.verify(); tx.verify();
} }