Use temporary array, just to avoid the possibility of some unexpected results
[NovacoinLibrary.git] / 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)