Use temporary array, just to avoid the possibility of some unexpected results
authorCryptoManiac <balthazar@yandex.ru>
Thu, 20 Aug 2015 17:50:04 +0000 (20:50 +0300)
committerCryptoManiac <balthazar@yandex.ru>
Thu, 20 Aug 2015 17:50:04 +0000 (20:50 +0300)
Novacoin/Interop.cs

index 1f9f0de..f0a05cf 100644 (file)
@@ -26,9 +26,13 @@ namespace Novacoin
     {
         public static byte[] ReverseBytes(byte[] source)
         {
-            Array.Reverse(source);
+            byte[] b = new byte[source.Length];
 
-            return source;
+            source.CopyTo(b, 0);
+
+            Array.Reverse(b);
+
+            return b;
         }
 
         public static byte[] LEBytes(uint[] values)