X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=Novacoin%2FCTxOut.cs;h=43c1f631bf0171a9abf059b5ceba34858f73e57a;hb=161220f258cf9eb640d354951a48b45598301b1a;hp=eb24845cbd503f15d2c0b6714fdb512a496ba074;hpb=be9d844557911f95165d2c9875c4f5b2822cfc92;p=NovacoinLibrary.git diff --git a/Novacoin/CTxOut.cs b/Novacoin/CTxOut.cs index eb24845..43c1f63 100644 --- a/Novacoin/CTxOut.cs +++ b/Novacoin/CTxOut.cs @@ -59,21 +59,21 @@ namespace Novacoin /// /// Read vout list from byte sequence. /// - /// Reference to byte sequence + /// Reference to binary reader /// Outputs array - public static CTxOut[] ReadTxOutList(ref ByteQueue wBytes) + internal static CTxOut[] ReadTxOutList(ref BinaryReader reader) { - int nOutputs = (int)wBytes.GetVarInt(); + int nOutputs = (int)VarInt.ReadVarInt(ref reader); var vout =new CTxOut[nOutputs]; for (int nIndex = 0; nIndex < nOutputs; nIndex++) { // Fill outputs array vout[nIndex] = new CTxOut(); - vout[nIndex].nValue = BitConverter.ToUInt64(wBytes.Get(8), 0); + vout[nIndex].nValue = reader.ReadUInt64(); - int nScriptPKLen = (int)wBytes.GetVarInt(); - vout[nIndex].scriptPubKey = new CScript(wBytes.Get(nScriptPKLen)); + int nScriptPKLen = (int)VarInt.ReadVarInt(ref reader); + vout[nIndex].scriptPubKey = new CScript(reader.ReadBytes(nScriptPKLen)); } return vout;