More attempts to fix build flakes.

This commit is contained in:
Mike Hearn 2014-11-24 14:24:35 +01:00
parent bd986f35f1
commit 1db2316fc3
2 changed files with 8 additions and 2 deletions

View File

@ -1043,12 +1043,12 @@ public class Block extends Message {
@VisibleForTesting
public Block createNextBlock(@Nullable Address to, TransactionOutPoint prevOut) {
return createNextBlock(to, prevOut, Utils.currentTimeSeconds(), pubkeyForTesting, FIFTY_COINS);
return createNextBlock(to, prevOut, getTimeSeconds() + 5, pubkeyForTesting, FIFTY_COINS);
}
@VisibleForTesting
public Block createNextBlock(@Nullable Address to, Coin value) {
return createNextBlock(to, null, Utils.currentTimeSeconds(), pubkeyForTesting, value);
return createNextBlock(to, null, getTimeSeconds() + 5, pubkeyForTesting, value);
}
@VisibleForTesting

View File

@ -445,10 +445,16 @@ public class PeerTest extends TestWithNetworkConnections {
blockChain.add(b1);
Utils.rollMockClock(60 * 10); // 10 minutes later.
Block b2 = makeSolvedTestBlock(b1);
b2.setTime(Utils.currentTimeSeconds());
b2.solve();
Utils.rollMockClock(60 * 10); // 10 minutes later.
Block b3 = makeSolvedTestBlock(b2);
b3.setTime(Utils.currentTimeSeconds());
b3.solve();
Utils.rollMockClock(60 * 10);
Block b4 = makeSolvedTestBlock(b3);
b4.setTime(Utils.currentTimeSeconds());
b4.solve();
// Request headers until the last 2 blocks.
peer.setDownloadParameters(Utils.currentTimeSeconds() - (600*2) + 1, false);