Remove zero only if serialized key is 33 bytes long.
authorCryptoManiac <balthazar.ad@gmail.com>
Thu, 27 Aug 2015 10:39:11 +0000 (13:39 +0300)
committerCryptoManiac <balthazar.ad@gmail.com>
Thu, 27 Aug 2015 10:39:11 +0000 (13:39 +0300)
Novacoin/CKeyPair.cs

index b1845d1..f2a051b 100644 (file)
@@ -184,7 +184,7 @@ namespace Novacoin
             {
                 var secretBytes = new List<byte>(_Private.D.ToByteArray());
 
-                if (secretBytes[0] == 0x00)
+                if (secretBytes.Count == 33 && secretBytes[0] == 0x00)
                 {
                     // Remove sign
                     secretBytes.RemoveAt(0);