/** Returns the first 32 bits of the result of {@link #getIdentifier()}. */ public int getFingerprint() { // TODO: why is this different than armory's fingerprint? BIP 32: "The first 32 bits of the identifier are called the fingerprint." return ByteBuffer.wrap(Arrays.copyOfRange(getIdentifier(), 0, 4)).getInt(); }
/** Returns the first 32 bits of the result of {@link #getIdentifier()}. */ public int getFingerprint() { // TODO: why is this different than armory's fingerprint? BIP 32: "The first 32 bits of the identifier are called the fingerprint." return ByteBuffer.wrap(Arrays.copyOfRange(getIdentifier(), 0, 4)).getInt(); }
/** Returns the first 32 bits of the result of {@link #getIdentifier()}. */ public int getFingerprint() { // TODO: why is this different than armory's fingerprint? BIP 32: "The first 32 bits of the identifier are called the fingerprint." return ByteBuffer.wrap(Arrays.copyOfRange(getIdentifier(), 0, 4)).getInt(); }
/** Returns the first 32 bits of the result of {@link #getIdentifier()}. */ public int getFingerprint() { // TODO: why is this different than armory's fingerprint? BIP 32: "The first 32 bits of the identifier are called the fingerprint." return ByteBuffer.wrap(Arrays.copyOfRange(getIdentifier(), 0, 4)).getInt(); }
/** * Work out which restore method to use, depending on if it is a Trezor wallet or not and what backups there are */ public void calculateRestoreMethod() { Optional<HardwareWalletService> hardwareWalletService = CoreServices.getCurrentHardwareWalletService(); // User has selected restore wallet - see if wallet is hard Trezor wallet // If so no need to enter a seed phrase - use the rootNode from the master public key to work out the wallet id HardwareWalletContext context = hardwareWalletService.get().getContext(); // Create a wallet id from the rootNode to work out the wallet root directory if (context.getDeterministicKey().isPresent()) { walletId = Optional.of(new WalletId(context.getDeterministicKey().get().getIdentifier())); String walletRoot = WalletManager.createWalletRoot(walletId.get()); log.debug("Hardware wallet root : {}", walletRoot); } // Ensure Trezor is cancelled hardwareWalletService.get().requestCancel(); restoreMethod = RESTORE_WALLET_HARD_TREZOR; if (!isLocalZipBackupPresent()) { // Next ask for the cloud backup location state = RESTORE_WALLET_SELECT_BACKUP_LOCATION; } else { // Next select one of the local backups state = RESTORE_WALLET_SELECT_BACKUP; } }
final WalletId walletId = new WalletId(rootNode.getIdentifier()); String walletRoot = createWalletRoot(walletId);