From 2df74e97dc401b2efdf1ab531420341a1fd04e1a Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Wed, 5 Mar 2014 17:27:26 +0100 Subject: [PATCH] Update checkpoint sanity for mainnet and testnet. --- .../google/bitcoin/tools/BuildCheckpoints.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/src/main/java/com/google/bitcoin/tools/BuildCheckpoints.java b/tools/src/main/java/com/google/bitcoin/tools/BuildCheckpoints.java index a910bdad..048c9d93 100644 --- a/tools/src/main/java/com/google/bitcoin/tools/BuildCheckpoints.java +++ b/tools/src/main/java/com/google/bitcoin/tools/BuildCheckpoints.java @@ -91,9 +91,18 @@ public class BuildCheckpoints { // Sanity check the created file. CheckpointManager manager = new CheckpointManager(PARAMS, new FileInputStream(CHECKPOINTS_FILE)); checkState(manager.numCheckpoints() == checkpoints.size()); - StoredBlock test = manager.getCheckpointBefore(1348310800); // Just after block 200,000 - checkState(test.getHeight() == 199584); - checkState(test.getHeader().getHashAsString().equals("000000000000002e00a243fe9aa49c78f573091d17372c2ae0ae5e0f24f55b52")); + + if (PARAMS.getId() == NetworkParameters.ID_MAINNET) { + StoredBlock test = manager.getCheckpointBefore(1390500000); // Thu Jan 23 19:00:00 CET 2014 + checkState(test.getHeight() == 280224); + checkState(test.getHeader().getHashAsString() + .equals("00000000000000000b5d59a15f831e1c45cb688a4db6b0a60054d49a9997fa34")); + } else if (PARAMS.getId() == NetworkParameters.ID_TESTNET) { + StoredBlock test = manager.getCheckpointBefore(1390500000); // Thu Jan 23 19:00:00 CET 2014 + checkState(test.getHeight() == 167328); + checkState(test.getHeader().getHashAsString() + .equals("0000000000035ae7d5025c2538067fe7adb1cf5d5d9c31b024137d9090ed13a9")); + } System.out.println("Checkpoints written to '" + CHECKPOINTS_FILE.getCanonicalPath() + "'."); }