mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-23 14:40:40 +01:00
WalletTool: Fix checkpoint is ignored when synching.
This commit is contained in:
parent
3fea6428ef
commit
4c953cc538
1 changed files with 3 additions and 4 deletions
|
@ -1230,7 +1230,6 @@ public class WalletTool {
|
||||||
}
|
}
|
||||||
if (mode == ValidationMode.SPV) {
|
if (mode == ValidationMode.SPV) {
|
||||||
store = new SPVBlockStore(params, chainFileName);
|
store = new SPVBlockStore(params, chainFileName);
|
||||||
chain = new BlockChain(params, wallet, store);
|
|
||||||
if (reset) {
|
if (reset) {
|
||||||
try {
|
try {
|
||||||
CheckpointManager.checkpoint(params, CheckpointManager.openStream(params), store,
|
CheckpointManager.checkpoint(params, CheckpointManager.openStream(params), store,
|
||||||
|
@ -1242,10 +1241,10 @@ public class WalletTool {
|
||||||
System.out.println("Could not load checkpoints: " + x.getMessage());
|
System.out.println("Could not load checkpoints: " + x.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
chain = new BlockChain(params, wallet, store);
|
||||||
} else if (mode == ValidationMode.FULL) {
|
} else if (mode == ValidationMode.FULL) {
|
||||||
FullPrunedBlockStore s = new H2FullPrunedBlockStore(params, chainFileName.getAbsolutePath(), 5000);
|
store = new H2FullPrunedBlockStore(params, chainFileName.getAbsolutePath(), 5000);
|
||||||
store = s;
|
chain = new FullPrunedBlockChain(params, wallet, (FullPrunedBlockStore) store);
|
||||||
chain = new FullPrunedBlockChain(params, wallet, s);
|
|
||||||
}
|
}
|
||||||
// This will ensure the wallet is saved when it changes.
|
// This will ensure the wallet is saved when it changes.
|
||||||
wallet.autosaveToFile(walletFile, 5, TimeUnit.SECONDS, null);
|
wallet.autosaveToFile(walletFile, 5, TimeUnit.SECONDS, null);
|
||||||
|
|
Loading…
Add table
Reference in a new issue