Static methods for output array serialization and deserialization.
authorCryptoManiac <balthazar@yandex.ru>
Sat, 5 Sep 2015 13:37:32 +0000 (16:37 +0300)
committerCryptoManiac <balthazar@yandex.ru>
Sat, 5 Sep 2015 13:37:32 +0000 (16:37 +0300)
Novacoin/COutPoint.cs

index 09d0690..b236ccd 100644 (file)
@@ -88,6 +88,11 @@ namespace Novacoin
             return outBytes;
         }
 
+        public static implicit operator COutPoint(byte[] b)
+        {
+            return new COutPoint(b);
+        }
+
         public override string ToString()
         {
             var sb = new StringBuilder();
@@ -123,6 +128,11 @@ namespace Novacoin
         /// <returns>Result of comparison.</returns>
         public bool Equals(COutPoint o)
         {
+            if (object.ReferenceEquals(o, null))
+            {
+                return false;
+            }
+
             return (o.n == n) && (o.hash == hash);
         }
     }