Пример #1
0
        public static void SetUniqueIdForVOut(TransactionVOut vout)
        {
            vout.Id = "42";
            var ss   = JsonConvert.SerializeObject(vout) + DateTime.UtcNow.Ticks.ToString();
            var hash = Convert.ToBase64String(SHA256.Create().ComputeHash(Encoding.UTF8.GetBytes(ss)));

            vout.Id = hash;
        }
Пример #2
0
        public static TransactionVOut GetVoutFromSqlReader(SQLiteDataReader reader)
        {
            long valueInt;

            if (!long.TryParse(reader["amount"].ToString(), out valueInt))
            {
                return(null);
            }

            var vout = new TransactionVOut()
            {
                Id          = reader["id"].ToString(),
                FromAddress = reader["fromaddr"].ToString(),
                ToAddress   = reader["toaddr"].ToString(),
                Amount      = valueInt,
                FromBlock   = reader["inblock"].ToString()
            };

            return(vout);
        }