bitpay / bitcore-lib

A pure and powerful JavaScript Bitcoin library
https://bitcore.io/
Other
611 stars 1.03k forks source link

Read address version as unsigned integer #137

Open gabmontes opened 7 years ago

gabmontes commented 7 years ago

This change prevents large address versions (larger than 0x7fffffff) to be read as negative numbers and failing to lookup the correct network from the Networks map.

Large address versions could eventually be found in custom network definitions. We had do create a custom network and address version resulted in a large numbers in order for the HD private/public keys to have the initial chars as desired. As the library read those large number as negative, it was unable to find the network in the networkMaps for certain operations.