public void Deserialize(Transaction trans, Stream reader) { var slen = Transaction.readVarInt(reader); script = new byte[slen]; reader.Read(script, 0, (int)slen); if (trans.version >= 1) { var bs = new byte[8]; reader.Read(bs, 0, 8); gas = new Fixed8(BitConverter.ToUInt64(bs, 0)); } }
public void Deserialize(Transaction trans, Stream reader) { var countClaims = (int)Transaction.readVarInt(reader); this.claims = new TransactionInput[countClaims]; for (var i = 0; i < countClaims; i++) { this.claims[i] = new TransactionInput(); this.claims[i].hash = new byte[32]; reader.Read(this.claims[i].hash, 0, 32); var buf = new byte[2]; reader.Read(buf, 0, 2); UInt16 index = (UInt16)(buf[1] * 256 + buf[0]); this.claims[i].index = index; } }