wallet: accept both private and public keys
This commit is contained in:
parent
f9dc43eba2
commit
a77083ce66
@ -26,8 +26,8 @@ function Wallet(options, passphrase) {
|
||||
pers: options.scope,
|
||||
entropy: hash.sha256().update(options.passphrase).digest()
|
||||
});
|
||||
} else if (options.priv) {
|
||||
this.key = bcoin.ecdsa.keyPair(options.priv);
|
||||
} else if (options.priv || options.pub) {
|
||||
this.key = bcoin.ecdsa.keyPair(options.priv || options.pub, 'hex');
|
||||
} else {
|
||||
this.key = bcoin.ecdsa.genKeyPair();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user