private static void reset() { // Delete the transactions and save. In future, reset the chain head pointer. wallet.clearTransactions(0); saveWallet(walletFile); }
/** * Deletes transactions which appeared above the given block height from the wallet, but does not touch the keys. * This is useful if you have some keys and wish to replay the block chain into the wallet in order to pick them up. * Triggers auto saving. */ public void clearTransactions(int fromHeight) { lock.lock(); try { if (fromHeight == 0) { clearTransactions(); saveLater(); } else { throw new UnsupportedOperationException(); } } finally { lock.unlock(); } }
/** * Deletes transactions which appeared above the given block height from the wallet, but does not touch the keys. * This is useful if you have some keys and wish to replay the block chain into the wallet in order to pick them up. * Triggers auto saving. */ public void clearTransactions(int fromHeight) { lock.lock(); try { if (fromHeight == 0) { clearTransactions(); saveLater(); } else { throw new UnsupportedOperationException(); } } finally { lock.unlock(); } }
/** * Deletes transactions which appeared above the given block height from the wallet, but does not touch the keys. * This is useful if you have some keys and wish to replay the block chain into the wallet in order to pick them up. * Triggers auto saving. */ public void clearTransactions(int fromHeight) { lock.lock(); try { if (fromHeight == 0) { clearTransactions(); saveLater(); } else { throw new UnsupportedOperationException(); } } finally { lock.unlock(); } }
/** * Deletes transactions which appeared above the given block height from the wallet, but does not touch the keys. * This is useful if you have some keys and wish to replay the block chain into the wallet in order to pick them up. * Triggers auto saving. */ public void clearTransactions(int fromHeight) { lock.lock(); try { if (fromHeight == 0) { clearTransactions(); saveLater(); } else { throw new UnsupportedOperationException(); } } finally { lock.unlock(); } }
/** * Prepares the wallet for a blockchain replay. Removes all transactions (as they would get in the way of the * replay) and makes the wallet think it has never seen a block. {@link WalletEventListener#onWalletChanged} will * be fired. */ public void reset() { lock.lock(); try { clearTransactions(); lastBlockSeenHash = null; lastBlockSeenHeight = -1; // Magic value for 'never'. lastBlockSeenTimeSecs = 0; saveLater(); maybeQueueOnWalletChanged(); } finally { lock.unlock(); } }
/** * Prepares the wallet for a blockchain replay. Removes all transactions (as they would get in the way of the * replay) and makes the wallet think it has never seen a block. {@link WalletEventListener#onWalletChanged} will * be fired. */ public void reset() { lock.lock(); try { clearTransactions(); lastBlockSeenHash = null; lastBlockSeenHeight = -1; // Magic value for 'never'. lastBlockSeenTimeSecs = 0; saveLater(); maybeQueueOnWalletChanged(); } finally { lock.unlock(); } }
/** * Prepares the wallet for a blockchain replay. Removes all transactions (as they would get in the way of the * replay) and makes the wallet think it has never seen a block. {@link WalletEventListener#onWalletChanged} will * be fired. */ public void reset() { lock.lock(); try { clearTransactions(); lastBlockSeenHash = null; lastBlockSeenHeight = -1; // Magic value for 'never'. lastBlockSeenTimeSecs = 0; saveLater(); maybeQueueOnWalletChanged(); } finally { lock.unlock(); } }
/** * Prepares the wallet for a blockchain replay. Removes all transactions (as they would get in the way of the * replay) and makes the wallet think it has never seen a block. {@link WalletEventListener#onWalletChanged} will * be fired. */ public void reset() { lock.lock(); try { clearTransactions(); lastBlockSeenHash = null; lastBlockSeenHeight = -1; // Magic value for 'never'. lastBlockSeenTimeSecs = 0; saveLater(); maybeQueueOnWalletChanged(); } finally { lock.unlock(); } }
wallet.clearTransactions(0); File chainFile = new File("restore-from-seed.spvchain"); if (chainFile.exists()) {