如果不提供pathIndex,默认为0
This commit is contained in:
parent
c5b0d40150
commit
e304a5004a
6
ticc.js
6
ticc.js
@ -518,11 +518,11 @@ class TicCrypto {
|
||||
let part5 = parseInt(pathHash.slice(30, 32), 16)
|
||||
path = `${part0}'/${part1}/${part2}/${part3}/${part4}/${part5}`
|
||||
} else {
|
||||
// 本方法也可用来生成默认的第0个路径,例如 "m/44'/0'/0'/0/0"
|
||||
path = "0'/0/0"
|
||||
// 本方法也可用来生成默认路径,例如 "m/44'/0'/0'/0/0"
|
||||
path = "0'/0" // Account'/Change
|
||||
}
|
||||
// 注意,如果 pathIndex 为 undefinded 或者非数字,得出的 path 是不同的!
|
||||
pathIndex = parseInt(pathIndex)
|
||||
pathIndex = parseInt(pathIndex) || 0
|
||||
if (0 <= pathIndex && pathIndex <= 0x7fffffff) {
|
||||
path += `/${pathIndex}`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user