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,16 +40,20 @@ public class BlockImporter {
|
|||
params = MainNetParams.get();
|
||||
|
||||
BlockStore store;
|
||||
if (args[1].equals("MemFull")) {
|
||||
switch (args[1]) {
|
||||
case "MemFull":
|
||||
Preconditions.checkArgument(args.length == 2);
|
||||
store = new MemoryFullPrunedBlockStore(params, 100);
|
||||
} else if (args[1].equals("Mem")) {
|
||||
break;
|
||||
case "Mem":
|
||||
Preconditions.checkArgument(args.length == 2);
|
||||
store = new MemoryBlockStore(params);
|
||||
} else if (args[1].equals("SPV")) {
|
||||
break;
|
||||
case "SPV":
|
||||
Preconditions.checkArgument(args.length == 3);
|
||||
store = new SPVBlockStore(params, new File(args[2]));
|
||||
} else {
|
||||
break;
|
||||
default:
|
||||
System.err.println("Unknown store " + args[1]);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue