using provided isValid method of coinstring

This commit is contained in:
jash
2018-10-06 22:18:25 +02:00
committed by kexkey
parent 5f3e8fd518
commit ce8ccd2231

View File

@@ -78,11 +78,11 @@ module.exports = class extends Generator {
}
_xkeyValidator( xpub ) {
try {
coinstring.decode(xpub);
} catch( e ) {
throw new Error('Invalid extended public key. Please check your input.');
// TOOD: check for version
if( !coinstring.isValid( xpub ) ) {
throw new Error('Not an extended key.');
}
return true;
}