Esempio n. 1
0
 public void WriteStream(BinaryWriter bw)
 {
     bw.Write(txnHash.hex);
     bw.Write(vout);
     VarInt.WriteStream(bw, firstVarIntByteScriptLength, inputScriptLength);
     bw.Write(inputScript);
     bw.Write(sequenceNum);
 }
Esempio n. 2
0
        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())));
                }
            }
        }
Esempio n. 3
0
 public void WriteStream(BinaryWriter bw)
 {
     bw.Write(value);
     VarInt.WriteStream(bw, firstVarIntByteScriptLength, outputScriptLength);
     bw.Write(scriptPubKey.scriptPubKey);
 }