Fixing unit tests

This commit is contained in:
catbref
2019-10-30 13:19:56 +00:00
parent fef16e7620
commit 62e2fd759c
12 changed files with 93 additions and 44 deletions

View File

@@ -1301,6 +1301,7 @@ public class Controller extends Thread {
OnlineAccountData ourOnlineAccountData = new OnlineAccountData(onlineAccountsTimestamp, signature, publicKey);
synchronized (this.onlineAccounts) {
this.onlineAccounts.clear();
this.onlineAccounts.add(ourOnlineAccountData);
}
}

View File

@@ -256,6 +256,11 @@ public class BTC {
peerGroup.addWallet(wallet);
peerGroup.setFastCatchupTimeSecs(startTime);
peerGroup.addBlocksDownloadedEventListener((peer, block, filteredBlock, blocksLeft) -> {
if (blocksLeft % 1000 == 0)
System.out.println("Blocks left: " + blocksLeft);
});
System.out.println("Starting download...");
peerGroup.downloadBlockChain();
@@ -273,7 +278,7 @@ public class BTC {
}
public void updateCheckpoints() {
final long now = new Date().getTime() / 1000;
final long now = new Date().getTime() / 1000 - 86400;
try {
StoredBlock checkpoint = manager.getCheckpointBefore(now);
@@ -288,6 +293,12 @@ public class BTC {
chain.addNewBestBlockListener(Threading.SAME_THREAD, manager);
peerGroup.addBlocksDownloadedEventListener((peer, block, filteredBlock, blocksLeft) -> {
if (blocksLeft % 1000 == 0)
System.out.println("Blocks left: " + blocksLeft);
});
System.out.println("Starting download...");
peerGroup.downloadBlockChain();
try {