@Test public void getAddressTests() throws Exception { Transaction tx = new Transaction(MAINNET); tx.addOutput(Coin.CENT, ScriptBuilder.createOpReturnScript("hello world!".getBytes())); assertTrue(ScriptPattern.isOpReturn(tx.getOutput(0).getScriptPubKey())); assertFalse(ScriptPattern.isP2PK(tx.getOutput(0).getScriptPubKey())); assertFalse(ScriptPattern.isP2PKH(tx.getOutput(0).getScriptPubKey())); }
public Script getScriptPubKey() throws ScriptException { if (scriptPubKey == null) { scriptPubKey = new Script(scriptBytes); } return scriptPubKey; }
TransactionOutput extends ChildMessage { public Script getScriptPubKey() throws ScriptException { if (scriptPubKey == null) { scriptPubKey = new Script(scriptBytes); } return scriptPubKey; } }
TransactionOutput extends ChildMessage { public Script getScriptPubKey() throws ScriptException { if (scriptPubKey == null) { scriptPubKey = new Script(scriptBytes); } return scriptPubKey; } TransactionOutput(NetworkParameters params, @Nullable Transaction parent, byte[] payload,
                             int offset);  TransactionOutput(NetworkParameters params, @Nullable Transaction parent, byte[] payload, int offset, MessageSerializer serializer);  TransactionOutput(NetworkParameters params, @Nullable Transaction parent, Coin value, Address to);  TransactionOutput(NetworkParameters params, @Nullable Transaction parent, Coin value, ECKey to);  TransactionOutput(NetworkParameters params, @Nullable Transaction parent, Coin value, byte[] scriptBytes); }
TransactionOutput extends ChildMessage { public Script getScriptPubKey() throws ScriptException { if (scriptPubKey == null) { scriptPubKey = new Script(scriptBytes); } return scriptPubKey; } TransactionOutput(NetworkParameters params, @Nullable Transaction parent, byte[] payload,
                             int offset);  TransactionOutput(NetworkParameters params, @Nullable Transaction parent, byte[] payload, int offset, MessageSerializer serializer);  TransactionOutput(NetworkParameters params, @Nullable Transaction parent, Coin value, Address to);  TransactionOutput(NetworkParameters params, @Nullable Transaction parent, Coin value, ECKey to);  TransactionOutput(NetworkParameters params, @Nullable Transaction parent, Coin value, byte[] scriptBytes); Script getScriptPubKey(); @Nullable @Deprecated LegacyAddress getAddressFromP2PKHScript(NetworkParameters params); @Nullable @Deprecated LegacyAddress getAddressFromP2SH(NetworkParameters params); Coin getValue(); void setValue(Coin value); int getIndex(); boolean isDust(); Coin getMinNonDustValue(Coin feePerKb); Coin getMinNonDustValue(); void markAsSpent(TransactionInput input); void markAsUnspent(); boolean isAvailableForSpending(); byte[] getScriptBytes(); boolean isMineOrWatched(TransactionBag transactionBag); boolean isWatched(TransactionBag transactionBag); boolean isMine(TransactionBag transactionBag); @Override String toString(); @Nullable TransactionInput getSpentBy(); @Nullable Transaction getParentTransaction(); @Nullable Sha256Hash getParentTransactionHash(); int getParentTransactionDepthInBlocks(); TransactionOutPoint getOutPointFor(); TransactionOutput duplicateDetached(); @Override boolean equals(Object o); @Override int hashCode(); }
TransactionOutput extends ChildMessage { public Script getScriptPubKey() throws ScriptException { if (scriptPubKey == null) { scriptPubKey = new Script(scriptBytes); } return scriptPubKey; } TransactionOutput(NetworkParameters params, @Nullable Transaction parent, byte[] payload,
                             int offset);  TransactionOutput(NetworkParameters params, @Nullable Transaction parent, byte[] payload, int offset, MessageSerializer serializer);  TransactionOutput(NetworkParameters params, @Nullable Transaction parent, Coin value, Address to);  TransactionOutput(NetworkParameters params, @Nullable Transaction parent, Coin value, ECKey to);  TransactionOutput(NetworkParameters params, @Nullable Transaction parent, Coin value, byte[] scriptBytes); Script getScriptPubKey(); @Nullable @Deprecated LegacyAddress getAddressFromP2PKHScript(NetworkParameters params); @Nullable @Deprecated LegacyAddress getAddressFromP2SH(NetworkParameters params); Coin getValue(); void setValue(Coin value); int getIndex(); boolean isDust(); Coin getMinNonDustValue(Coin feePerKb); Coin getMinNonDustValue(); void markAsSpent(TransactionInput input); void markAsUnspent(); boolean isAvailableForSpending(); byte[] getScriptBytes(); boolean isMineOrWatched(TransactionBag transactionBag); boolean isWatched(TransactionBag transactionBag); boolean isMine(TransactionBag transactionBag); @Override String toString(); @Nullable TransactionInput getSpentBy(); @Nullable Transaction getParentTransaction(); @Nullable Sha256Hash getParentTransactionHash(); int getParentTransactionDepthInBlocks(); TransactionOutPoint getOutPointFor(); TransactionOutput duplicateDetached(); @Override boolean equals(Object o); @Override int hashCode();  }