Open fanatid opened 8 years ago
Shouldn't it throw with an invalid argument?
No. If _getDerivationIndexes
return null
, _deriveFromString
throw error on checking path: https://github.com/bitpay/bitcore-lib/blob/4430479cea370ea07ed02272776932f76bcd2908/lib/hdprivatekey.js#L211
It looks like the behavior currently is that hdPrivateKey.derive('m/2/3')
and hdPrivateKey.derive('m/2.1/3')
will generate the same key.
Instead
[ 2.1, 3 ]
result should benull
Discussion in bitcoinjs-lib: https://github.com/bitcoinjs/bitcoinjs-lib/pull/538