mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-09 16:04:54 +01:00
BlockImporter: use switch statement for store argument
This commit is contained in:
parent
e6a4dd4718
commit
0d6da641d8
1 changed files with 16 additions and 12 deletions
|
@ -40,18 +40,22 @@ public class BlockImporter {
|
||||||
params = MainNetParams.get();
|
params = MainNetParams.get();
|
||||||
|
|
||||||
BlockStore store;
|
BlockStore store;
|
||||||
if (args[1].equals("MemFull")) {
|
switch (args[1]) {
|
||||||
Preconditions.checkArgument(args.length == 2);
|
case "MemFull":
|
||||||
store = new MemoryFullPrunedBlockStore(params, 100);
|
Preconditions.checkArgument(args.length == 2);
|
||||||
} else if (args[1].equals("Mem")) {
|
store = new MemoryFullPrunedBlockStore(params, 100);
|
||||||
Preconditions.checkArgument(args.length == 2);
|
break;
|
||||||
store = new MemoryBlockStore(params);
|
case "Mem":
|
||||||
} else if (args[1].equals("SPV")) {
|
Preconditions.checkArgument(args.length == 2);
|
||||||
Preconditions.checkArgument(args.length == 3);
|
store = new MemoryBlockStore(params);
|
||||||
store = new SPVBlockStore(params, new File(args[2]));
|
break;
|
||||||
} else {
|
case "SPV":
|
||||||
System.err.println("Unknown store " + args[1]);
|
Preconditions.checkArgument(args.length == 3);
|
||||||
return;
|
store = new SPVBlockStore(params, new File(args[2]));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
System.err.println("Unknown store " + args[1]);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractBlockChain chain = null;
|
AbstractBlockChain chain = null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue