diff --git a/core/src/main/java/com/google/bitcoin/core/Peer.java b/core/src/main/java/com/google/bitcoin/core/Peer.java index db32fe89..f19e8c00 100644 --- a/core/src/main/java/com/google/bitcoin/core/Peer.java +++ b/core/src/main/java/com/google/bitcoin/core/Peer.java @@ -601,7 +601,7 @@ public class Peer { final ListenableFuture future = downloadDependenciesInternal(tx, new Object(), results); final SettableFuture> resultFuture = SettableFuture.create(); Futures.addCallback(future, new FutureCallback() { - public void onSuccess(Object _) { + public void onSuccess(Object ignored) { resultFuture.set(results); } diff --git a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java index b18c4c51..ff768ea8 100644 --- a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java +++ b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java @@ -1290,7 +1290,7 @@ public class PeerGroup extends AbstractIdleService implements TransactionBroadca // any peer discovery source and the user just calls connectTo() once. if (minConnections == 1) { sendComplete.addListener(new ChannelFutureListener() { - public void operationComplete(ChannelFuture _) throws Exception { + public void operationComplete(ChannelFuture operation) throws Exception { for (Wallet wallet : wallets) { try { // Assumption here is there are no dependencies of the created transaction. diff --git a/core/src/test/java/com/google/bitcoin/core/PeerTest.java b/core/src/test/java/com/google/bitcoin/core/PeerTest.java index 38942f7e..df1e2eec 100644 --- a/core/src/test/java/com/google/bitcoin/core/PeerTest.java +++ b/core/src/test/java/com/google/bitcoin/core/PeerTest.java @@ -836,7 +836,7 @@ public class PeerTest extends TestWithNetworkConnections { } }; ServerSocket server = new ServerSocket(0); - final NetworkParameters params = TestNet3Params.testNet(); + final NetworkParameters params = TestNet3Params.get(); Peer peer = new Peer(params, blockChain, "test", "1.0"); ListenableFuture future = TCPNetworkConnection.connectTo(TestNet3Params.get(), new InetSocketAddress(InetAddress.getLocalHost(), server.getLocalPort()), 5000, peer); diff --git a/core/src/test/java/com/google/bitcoin/core/UtilsTest.java b/core/src/test/java/com/google/bitcoin/core/UtilsTest.java index 8eddeff3..53e31358 100644 --- a/core/src/test/java/com/google/bitcoin/core/UtilsTest.java +++ b/core/src/test/java/com/google/bitcoin/core/UtilsTest.java @@ -22,9 +22,7 @@ import org.junit.Test; import java.math.BigInteger; import static com.google.bitcoin.core.Utils.*; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.fail; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; public class UtilsTest { diff --git a/tools/src/main/java/com/google/bitcoin/tools/BlockImporter.java b/tools/src/main/java/com/google/bitcoin/tools/BlockImporter.java index beae7635..d02bc5ed 100644 --- a/tools/src/main/java/com/google/bitcoin/tools/BlockImporter.java +++ b/tools/src/main/java/com/google/bitcoin/tools/BlockImporter.java @@ -1,49 +1,33 @@ package com.google.bitcoin.tools; -import java.io.File; - -import com.google.bitcoin.core.AbstractBlockChain; -import com.google.bitcoin.core.Block; -import com.google.bitcoin.core.BlockChain; -import com.google.bitcoin.core.FullPrunedBlockChain; -import com.google.bitcoin.core.NetworkParameters; -import com.google.bitcoin.core.PrunedException; -import com.google.bitcoin.core.VerificationException; +import com.google.bitcoin.core.*; import com.google.bitcoin.params.MainNetParams; import com.google.bitcoin.params.TestNet3Params; -import com.google.bitcoin.store.BlockStore; -import com.google.bitcoin.store.BlockStoreException; -import com.google.bitcoin.store.BoundedOverheadBlockStore; -import com.google.bitcoin.store.FullPrunedBlockStore; -import com.google.bitcoin.store.H2FullPrunedBlockStore; -import com.google.bitcoin.store.MemoryBlockStore; -import com.google.bitcoin.store.MemoryFullPrunedBlockStore; -import com.google.bitcoin.store.SPVBlockStore; +import com.google.bitcoin.store.*; import com.google.bitcoin.utils.BlockFileLoader; import com.google.common.base.Preconditions; -/** Very thin wrapper around {@link com.google.bitcoin.util.BlockFileLoader} */ +import java.io.File; + +/** Very thin wrapper around {@link com.google.bitcoin.utils.BlockFileLoader} */ public class BlockImporter { public static void main(String[] args) throws BlockStoreException, VerificationException, PrunedException { - System.out.println("USAGE: BlockImporter (prod|test) (H2|BoundedOverhead|Disk|MemFull|Mem|SPV) [blockStore]"); + System.out.println("USAGE: BlockImporter (prod|test) (H2|Disk|MemFull|Mem|SPV) [blockStore]"); System.out.println(" blockStore is required unless type is Mem or MemFull"); System.out.println(" eg BlockImporter prod H2 /home/user/bitcoinj.h2store"); System.out.println(" Does full verification if the store supports it"); Preconditions.checkArgument(args.length == 2 || args.length == 3); - NetworkParameters params = null; + NetworkParameters params; if (args[0].equals("test")) params = TestNet3Params.get(); else params = MainNetParams.get(); - BlockStore store = null; + BlockStore store; if (args[1].equals("H2")) { Preconditions.checkArgument(args.length == 3); store = new H2FullPrunedBlockStore(params, args[2], 100); - } else if (args[1].equals("BoundedOverhead")) { - Preconditions.checkArgument(args.length == 3); - store = new BoundedOverheadBlockStore(params, new File(args[2])); } else if (args[1].equals("MemFull")) { Preconditions.checkArgument(args.length == 2); store = new MemoryFullPrunedBlockStore(params, 100); @@ -53,6 +37,9 @@ public class BlockImporter { } else if (args[1].equals("SPV")) { Preconditions.checkArgument(args.length == 3); store = new SPVBlockStore(params, new File(args[2])); + } else { + System.err.println("Unknown store " + args[1]); + return; } AbstractBlockChain chain = null;