Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
hotfix and new pools
  • Loading branch information
daWallet committed Jul 12, 2016
1 parent 84eb567 commit 841733f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 6 deletions.
6 changes: 0 additions & 6 deletions burst_1.2.4/.gitignore

This file was deleted.

Binary file modified burst_1.2.4/Burst_Wallet.exe
Binary file not shown.
Binary file added burst_1.2.4/burst.jar
Binary file not shown.
32 changes: 32 additions & 0 deletions burst_1.2.4/src/java/nxt/BlockchainProcessorImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ public void run() {
}

long currentBlockId = (lastDownloaded == 0 ? commonBlockId : lastDownloaded);
if(commonBlock.getHeight() < blockchain.getLastBlock().getHeight()) { // fork point
currentBlockId = commonBlockId;
}

List<BlockImpl> forkBlocks = new ArrayList<>();

boolean processedAll = true;
Expand Down Expand Up @@ -986,7 +990,35 @@ private BlockImpl popLastBlock() {
for (TransactionImpl transaction : block.getTransactions()) {
transaction.unsetBlock();
}
Logger.logErrorMessage("popping a block: " + block.getId());
long headTx = 0;
if(block.getTransactions().size() > 0) {
headTx = block.getTransactions().get(0).getId();
Logger.logErrorMessage("head tx:" + headTx);
}
if(headTx != 0 && TransactionDb.hasTransaction(headTx)) {
Logger.logErrorMessage("before pop has tx");
}
BlockDb.deleteBlocksFrom(block.getId());
if(headTx != 0 && TransactionDb.hasTransaction(headTx)) {
Logger.logErrorMessage("after pop has tx");
try(Connection con = Db.getConnection();
PreparedStatement pstmt = con.prepareStatement("DELETE FROM TRANSACTION WHERE block_id = ?")) {
pstmt.setLong(1, block.getId());
pstmt.executeUpdate();
} catch (SQLException e) {
Logger.logErrorMessage("failed delete", e);
}
if(TransactionDb.hasTransaction(headTx)) {
Logger.logErrorMessage("still has tx after delete attempt");
}
else {
Logger.logErrorMessage("tx was successfully deleted");
}
}
else {
Logger.logErrorMessage("after pop not have tx");
}
blockListeners.notify(block, Event.BLOCK_POPPED);
return previousBlock;
}
Expand Down
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ _____

Changelog:

0.3.1

+Hotfix for stucked local wallet.


0.3
Expand Down

0 comments on commit 841733f

Please sign in to comment.