X-Git-Url: https://git.novaco.in/?p=NovacoinLibrary.git;a=blobdiff_plain;f=Novacoin%2FCTransaction.cs;h=8402b1207698cd22cf3ccd1fb04cf54e5da18e86;hp=fb865a46167d7eaf25d771e8c4c79a4e5d70775c;hb=b9cd39da5b7744f29c938ec53a99f7595e71c9ad;hpb=fa431536d8e08b58341e06c29375463e2c056f27
diff --git a/Novacoin/CTransaction.cs b/Novacoin/CTransaction.cs
index fb865a4..8402b12 100644
--- a/Novacoin/CTransaction.cs
+++ b/Novacoin/CTransaction.cs
@@ -20,6 +20,7 @@ using System;
using System.Text;
using System.Collections.Generic;
using System.IO;
+using System.Diagnostics.Contracts;
namespace Novacoin
{
@@ -404,6 +405,23 @@ namespace Novacoin
}
///
+ /// Amount of novacoins spent by this transaction.
+ ///
+ public ulong ValueOut
+ {
+ get
+ {
+ ulong nValueOut = 0;
+ foreach (var txout in vout)
+ {
+ nValueOut += txout.nValue;
+ Contract.Assert(MoneyRange(txout.nValue) && MoneyRange(nValueOut));
+ }
+ return nValueOut;
+ }
+ }
+
+ ///
/// A sequence of bytes, which corresponds to the current state of CTransaction.
///
public static implicit operator byte[] (CTransaction tx)