OSDN Git Service

update the derivation path are null.
authorZhiting Lin <zlin035@uottawa.ca>
Fri, 13 Nov 2020 02:07:39 +0000 (10:07 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Fri, 13 Nov 2020 02:07:39 +0000 (10:07 +0800)
src/utils/account.js
src/utils/transaction/signTransaction.js

index ceecac5..29001ac 100644 (file)
@@ -3,5 +3,4 @@ import {decryptKey} from './key/keystore';
 export function restoreFromKeyStore(v3Keystore, password){
     const key = decryptKey(v3Keystore, password)
     return key.xPub;
-
 }
index 5244edb..6fa4537 100644 (file)
@@ -12,8 +12,10 @@ function signTransaction(transaction, password, keyJSON)  {
     for(let k = 0; k<tx.signingInstructions.length; k++){
         const v = tx.signingInstructions[k];
         let path = [];
-        for(let i = 0; i< v.derivationPath.length; i++ ){
-            path[i] = Buffer.from(v.derivationPath[i],"hex");
+        if(v.derivationPath){
+            for(let i = 0; i< v.derivationPath.length; i++ ){
+                path[i] = Buffer.from(v.derivationPath[i],"hex");
+            }
         }
         for(let d of v.signData ){