fix geth hdnode bug
This commit is contained in:
parent
765338885d
commit
f7856c7db7
1 changed files with 2 additions and 3 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
const _ = require('lodash/fp')
|
|
||||||
const Web3 = require('web3')
|
const Web3 = require('web3')
|
||||||
const web3 = new Web3()
|
const web3 = new Web3()
|
||||||
const hdkey = require('hdkey')
|
const hdkey = require('hdkey')
|
||||||
|
|
@ -140,12 +139,12 @@ function paymentHdNode (account) {
|
||||||
const masterSeed = account.seed
|
const masterSeed = account.seed
|
||||||
if (!masterSeed) throw new Error('No master seed!')
|
if (!masterSeed) throw new Error('No master seed!')
|
||||||
const key = hdkey.fromMasterSeed(masterSeed)
|
const key = hdkey.fromMasterSeed(masterSeed)
|
||||||
return key.derivePath(paymentPrefixPath)
|
return key.derive(paymentPrefixPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
function defaultHdNode (account) {
|
function defaultHdNode (account) {
|
||||||
const masterSeed = account.seed
|
const masterSeed = account.seed
|
||||||
if (!masterSeed) throw new Error('No master seed!')
|
if (!masterSeed) throw new Error('No master seed!')
|
||||||
const key = hdkey.fromMasterSeed(masterSeed)
|
const key = hdkey.fromMasterSeed(masterSeed)
|
||||||
return key.derivePath(defaultPrefixPath)
|
return key.derive(defaultPrefixPath)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue