mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-30 19:41:24 +00:00
Script: An empty script will return <empty> in toString().
This commit is contained in:
@@ -31,7 +31,6 @@ import org.bitcoinj.utils.ExchangeRate;
|
||||
import org.bitcoinj.wallet.Wallet;
|
||||
import org.bitcoinj.wallet.WalletTransaction.Pool;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.primitives.Ints;
|
||||
import com.google.common.primitives.Longs;
|
||||
@@ -751,8 +750,7 @@ public class Transaction extends ChildMessage {
|
||||
s.append("in ");
|
||||
|
||||
try {
|
||||
String scriptSigStr = in.getScriptSig().toString();
|
||||
s.append(!Strings.isNullOrEmpty(scriptSigStr) ? scriptSigStr : "<no scriptSig>");
|
||||
s.append(in.getScriptSig());
|
||||
final Coin value = in.getValue();
|
||||
if (value != null)
|
||||
s.append(" ").append(value.toFriendlyString());
|
||||
|
@@ -143,11 +143,14 @@ public class Script {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the program opcodes as a string, for example "[1234] DUP HASH160"
|
||||
* Returns the program opcodes as a string, for example "[1234] DUP HASH160", or "<empty>".
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return Utils.SPACE_JOINER.join(chunks);
|
||||
if (!chunks.isEmpty())
|
||||
return Utils.SPACE_JOINER.join(chunks);
|
||||
else
|
||||
return "<empty>";
|
||||
}
|
||||
|
||||
/** Returns the serialized program as a newly created byte array. */
|
||||
|
Reference in New Issue
Block a user