private static void applyWalletUpdates(Wallet wallet) { if (wallet.getVersion() < 2) { updateV1toV2(wallet); } if (wallet.getVersion() < 3) { updateV2toV3(wallet); } }
/** * Creates a deterministic key chain that watches the given (public only) root key. You can use this to calculate * balances and generally follow along, but spending is not possible with such a chain. Currently you can't use * this method to watch an arbitrary fragment of some other tree, this limitation may be removed in future. */ public SimpleHDKeyChain(DeterministicKey rootkey) { simpleKeyChain = new SimpleKeyChain(); initializeHierarchyUnencrypted(rootkey); }
@Override public void completeAndSignTx(SendRequest request) throws WalletAccountException { if (request.isCompleted()) { signTransaction(request); } else { completeTransaction(request); } }
public BitWalletSingleKey(CoinType coinType, ECKey key) { super(checkNotNull(coinType), Wallet.generateRandomId()); keys = new SimpleKeyChain(); keys.importKey(key); }
public void saveWalletLater() { if (wallet != null) { wallet.saveLater(); } }
private void clearDataAndThrow(List<byte[]> bytes, String message) throws KeyFormatException { clearData(bytes); throw new KeyFormatException(message); }
/** * Check if accounts exists for the spesific coin type */ public boolean isAccountExists(CoinType type) { return wallet != null && wallet.isAccountExists(type); }
@Override public void run() { registration.listener.onConnectivityStatus(connectivity); registration.listener.onWalletChanged(NxtFamilyWallet.this); } });
private void updateBalance() { if (account != null) { lastBalance = account.getBalance(); } }
@Override public void run() { registration.listener.onNewBlock(TransactionWatcherWallet.this); registration.listener.onWalletChanged(TransactionWatcherWallet.this); } });
/** * Returns the key chain found in the given list of keys. Used for unencrypted chains */ public static SimpleHDKeyChain fromProtobuf(List<Protos.Key> keys) throws UnreadableWalletException { return fromProtobuf(keys, null); }
/** * Sends coins to the given address but does not broadcast the resulting pending transaction. */ public BitSendRequest sendCoinsOffline(BitAddress address, Value amount) throws WalletAccountException { return sendCoinsOffline(address, amount, (KeyParameter) null); }
@Override public void run() { registration.listener.onTransactionBroadcastSuccess(TransactionWatcherWallet.this, tx); } });
@Override public void run() { registration.listener.onTransactionBroadcastFailure(TransactionWatcherWallet.this, tx); } });
private void addAccountEventListener(WalletAccount a) { if (a != null) { a.addEventListener(transactionChangeListener, Threading.SAME_THREAD); } }
private static void clearData(List<byte[]> bytes) { for (byte[] b : bytes) { clearData(b); } }
@Override public void run() { if (wallet != null) wallet.saveLater(); } };
private void clearDataAndThrow(byte[] bytes, String message) throws KeyFormatException { clearData(bytes); throw new KeyFormatException(message); }
/** * Check if account exists */ public boolean isAccountExists(String accountId) { if (wallet != null) { return wallet.isAccountExists(accountId); } else { return false; } }
@Override public void run() { if (wallet != null) wallet.saveLater(); } };