Buggy code:
public class ResetTransactionsSubmitAction implements Action { private static final int NUMBER_OF_MILLISECOND_IN_A_SECOND = 1000 ; private MultiBitController controller ; public ResetTransactionsSubmitAction ( MultiBitController controller ) { } public void execute ( DataProvider dataProvider ) { PerWalletModelData perWalletModelData = controller . getModel ( ) . getActivePerWalletModelData ( ) ; boolean haveFilesChanged = controller . getFileHandler ( ) . haveFilesChanged ( perWalletModelData ) ; if ( haveFilesChanged ) { perWalletModelData . setFilesHaveBeenChangedByAnotherProcess ( true ) ; controller . fireFilesHaveBeenChangedByAnotherProcess ( perWalletModelData ) ; } else { PerWalletModelData activePerWalletModelData = controller . getModel ( ) . getActivePerWalletModelData ( ) ; Date earliestTransactionDate = new Date ( ) ; boolean alreadyHaveEarliestTransactionDate = false ; String storedEarliestTransactionDate = activePerWalletModelData . getWalletInfo ( ) . getProperty ( EARLIEST_TRANSACTION_DATE ) ; if ( ( storedEarliestTransactionDate != null ) && ( ! ( "" . equals ( storedEarliestTransactionDate ) ) ) ) { try { earliestTransactionDate = new Date ( Long . parseLong ( storedEarliestTransactionDate ) ) ; alreadyHaveEarliestTransactionDate = true ; } catch ( NumberFormatException nfe ) { } } if ( ! alreadyHaveEarliestTransactionDate ) { Set < Transaction > allTransactions = activePerWalletModelData . getWallet ( ) . getTransactions ( true , true ) ; if ( allTransactions != null ) { for ( Transaction transaction : allTransactions ) { if ( transaction != null ) { Date updateTime = transaction . getUpdateTime ( ) ; if ( ( updateTime != null ) && ( earliestTransactionDate . after ( updateTime ) ) ) { earliestTransactionDate = updateTime ; } Date updateDate = transaction . getUpdatedAt ( ) ; if ( ( updateDate != null ) && ( earliestTransactionDate . after ( updateDate ) ) ) { earliestTransactionDate = updateDate ; } } } } activePerWalletModelData . getWalletInfo ( ) . put ( EARLIEST_TRANSACTION_DATE , ( "" + ( earliestTransactionDate . getTime ( ) ) ) ) ; } BlockChain blockChain = controller . getMultiBitService ( ) . getChain ( ) ; StoredBlock storedBlock = blockChain . getChainHead ( ) ; boolean haveGoneBackInTimeEnough = false ; boolean blockNavigationError = false ; <START_BUG> while ( ( ! haveGoneBackInTimeEnough ) || blockNavigationError ) { <END_BUG> Block header = storedBlock . getHeader ( ) ; long headerTimeInSeconds = header . getTimeSeconds ( ) ; if ( headerTimeInSeconds < ( ( earliestTransactionDate . getTime ( ) ) // ( ResetTransactionsSubmitAction . NUMBER_OF_MILLISECOND_IN_A_SECOND ) ) ) { haveGoneBackInTimeEnough = true ; } else { try { storedBlock = storedBlock . getPrev ( controller . getMultiBitService ( ) . getBlockStore ( ) ) ; } catch ( BlockStoreException e ) { e . printStackTrace ( ) ; blockNavigationError = true ; } } } if ( ! blockNavigationError ) { activePerWalletModelData . getWallet ( ) . removeAllTransactions ( ) ; try { blockChain . setChainHead ( storedBlock ) ; Thread workerThread = new Thread ( new Runnable ( ) { @ Override public void run ( ) { controller . getMultiBitService ( ) . downloadBlockChain ( ) ; } } ) ; workerThread . start ( ) ; } catch ( BlockStoreException e ) { e . printStackTrace ( ) ; } } controller . setActionForwardToSibling ( FORWARD_TO_SAME ) ; } } }

Fix:
while ( ( ! haveGoneBackInTimeEnough ) && ( ! blockNavigationError ) ) {