use ledger magic number path for entropy source
This commit is contained in:
parent
06c76d6351
commit
76bc61cf99
1 changed files with 5 additions and 3 deletions
|
|
@ -5,7 +5,9 @@ angular.module('copayApp.services')
|
||||||
var root = {};
|
var root = {};
|
||||||
var LEDGER_CHROME_ID = "kkdpmhnladdopljabkgpacgpliggeeaf";
|
var LEDGER_CHROME_ID = "kkdpmhnladdopljabkgpacgpliggeeaf";
|
||||||
root.MAX_SLOT = 20;
|
root.MAX_SLOT = 20;
|
||||||
root.ENTROPY_INDEX_START = 1000;
|
|
||||||
|
// Ledger magic number to get xPub without user confirmation
|
||||||
|
root.ENTROPY_INDEX_PATH = "m/0xb11e'/";
|
||||||
|
|
||||||
root.callbacks = {};
|
root.callbacks = {};
|
||||||
|
|
||||||
|
|
@ -16,8 +18,8 @@ angular.module('copayApp.services')
|
||||||
}
|
}
|
||||||
|
|
||||||
root.getEntropySource = function(index, callback) {
|
root.getEntropySource = function(index, callback) {
|
||||||
index = index + root.ENTROPY_INDEX_START;
|
var path = root.ENTROPY_INDEX_PATH + index + "'";
|
||||||
var xpub = root.getXPubKey("m/" + index + "'", function(data) {
|
var xpub = root.getXPubKey(path, function(data) {
|
||||||
if (!data.success) {
|
if (!data.success) {
|
||||||
$log.warn(data.message);
|
$log.warn(data.message);
|
||||||
return callback(data);
|
return callback(data);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue