using System.Text;
using System.Collections.Generic;
using System.IO;
+using System.Diagnostics.Contracts;
namespace Novacoin
{
/// <summary>
/// Transaction hash
/// </summary>
- public Hash256 Hash
+ public uint256 Hash
{
- get { return Hash256.Compute256(this); }
+ get { return CryptoUtils.ComputeHash256(this); }
+ }
+
+ /// <summary>
+ /// Amount of novacoins spent by this transaction.
+ /// </summary>
+ public ulong ValueOut
+ {
+ get
+ {
+ ulong nValueOut = 0;
+ foreach (var txout in vout)
+ {
+ nValueOut += txout.nValue;
+ Contract.Assert(MoneyRange(txout.nValue) && MoneyRange(nValueOut));
+ }
+ return nValueOut;
+ }
}
/// <summary>