}
/// <summary>
+ /// Initialize an empty instance of CTxIn class
+ /// </summary>
+ public CTxIn()
+ {
+ }
+
+ /// <summary>
/// Get raw bytes representation of our input.
/// </summary>
/// <returns>Byte sequence.</returns>
return inputBytes;
}
+ public bool IsCoinBase()
+ {
+ return txID.IsZero();
+ }
+
public override string ToString ()
{
StringBuilder sb = new StringBuilder ();
- sb.AppendFormat ("CTxIn(txId={0},n={1},scriptSig={2}", txID.ToString(), n, scriptSig.ToString());
+
+ if (IsCoinBase())
+ {
+ sb.AppendFormat("CTxIn(txId={0},coinbase={2},nSequence={3})", txID.ToString(), n, Interop.ToHex(scriptSig), nSequence);
+ }
+ else
+ {
+ sb.AppendFormat("CTxIn(txId={0},n={1},scriptSig={2},nSequence={3})", txID.ToString(), n, (new CScript(scriptSig)).ToString(), nSequence);
+ }
return sb.ToString ();
}