From ce8ccd2231d21d09ce3913a7cf7c0d357e8cef05 Mon Sep 17 00:00:00 2001 From: jash Date: Sat, 6 Oct 2018 22:18:25 +0200 Subject: [PATCH] using provided isValid method of coinstring --- install/generator-cyphernode/generators/app/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/generator-cyphernode/generators/app/index.js b/install/generator-cyphernode/generators/app/index.js index 4661a11..edd8611 100644 --- a/install/generator-cyphernode/generators/app/index.js +++ b/install/generator-cyphernode/generators/app/index.js @@ -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; }