* project file and use it here to find the right key in case the user restored from wallet seed words and thus
* we cannot find pubkey in our hashmaps.
*/
@Nullable
public DeterministicKey getAuthKeyFromIndexOrPubKey(byte[] pubkey, int index) {
DeterministicKey key = (DeterministicKey) findKeyFromPubKey(pubkey);
if (key == null) {
if (index == -1)
return null;
List<ChildNumber> path = checkNotNull(freshAuthKey().getParent()).getPath();
key = getKeyByPath(HDUtils.append(path, new ChildNumber(index)));
if (!Arrays.equals(key.getPubKey(), pubkey))
return null;
}
return key;
}