mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 09:50:32 +01:00
Fix to the PrivateKeys example. Thanks to recallfx for the patch.
This commit is contained in:
parent
4e568354be
commit
60e70bd79e
@ -39,9 +39,10 @@ public class PrivateKeys {
|
||||
NetworkParameters params = MainNetParams.get();
|
||||
try {
|
||||
// Decode the private key from Satoshis Base58 variant. If 51 characters long then it's from Bitcoins
|
||||
// dumpprivkey command and includes a version byte and checksum. Otherwise assume it's a raw key.
|
||||
// dumpprivkey command and includes a version byte and checksum, or if 52 characters long then it has
|
||||
// compressed pub key. Otherwise assume it's a raw key.
|
||||
ECKey key;
|
||||
if (args[0].length() == 51) {
|
||||
if (args[0].length() == 51 || args[0].length() == 52) {
|
||||
DumpedPrivateKey dumpedPrivateKey = new DumpedPrivateKey(params, args[0]);
|
||||
key = dumpedPrivateKey.getKey();
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user