public void WriteStream(BinaryWriter bw) { bw.Write(txnHash.hex); bw.Write(vout); VarInt.WriteStream(bw, firstVarIntByteScriptLength, inputScriptLength); bw.Write(inputScript); bw.Write(sequenceNum); }
private Hash GetTxId() { using (MemoryStream ms = new MemoryStream()) { using (BinaryWriter bw = new BinaryWriter(ms)) { bw.Write(versionNum); VarInt.WriteStream(bw, firstVarIntByteNInputs, nInputs); foreach (var input in inputs) { input.WriteStream(bw); } VarInt.WriteStream(bw, firstVarIntByteNOutputs, nOutputs); foreach (var output in outputs) { output.WriteStream(bw); } bw.Write(lockTime); return(new Hash(Crypto.DoubleSha256(ms.ToArray()))); } } }
public void WriteStream(BinaryWriter bw) { bw.Write(value); VarInt.WriteStream(bw, firstVarIntByteScriptLength, outputScriptLength); bw.Write(scriptPubKey.scriptPubKey); }