mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-07 06:44:16 +00:00
Fix indentation in core/pom, clear a couple of findbugs warnings that were introduced with the last commit.
This commit is contained in:
parent
fa10523007
commit
567fccbf8a
10
core/pom.xml
10
core/pom.xml
@ -162,11 +162,11 @@
|
||||
<artifactId>derby</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty</artifactId>
|
||||
<version>3.3.1.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty</artifactId>
|
||||
<version>3.3.1.Final</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.madgag</groupId>
|
||||
|
@ -16,22 +16,20 @@
|
||||
|
||||
package com.google.bitcoin.core;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.ConnectException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
import org.jboss.netty.channel.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.bitcoin.store.BlockStore;
|
||||
import com.google.bitcoin.store.BlockStoreException;
|
||||
import com.google.bitcoin.utils.EventListenerInvoker;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.jboss.netty.channel.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.ConnectException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
/**
|
||||
* A Peer handles the high level communication with a BitCoin node.
|
||||
@ -167,7 +165,7 @@ public class Peer {
|
||||
throws Exception {
|
||||
Message m = (Message)e.getMessage();
|
||||
|
||||
// Allow event listeners to filter the message stream. Listeners are allowed to drop messages by 178 synchronized (listener) {
|
||||
// Allow event listeners to filter the message stream. Listeners are allowed to drop messages by
|
||||
// returning null.
|
||||
for (PeerEventListener listener : eventListeners) {
|
||||
synchronized (listener) {
|
||||
|
@ -22,7 +22,6 @@ import com.google.bitcoin.discovery.PeerDiscovery;
|
||||
import com.google.bitcoin.discovery.PeerDiscoveryException;
|
||||
import com.google.bitcoin.utils.EventListenerInvoker;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import org.jboss.netty.bootstrap.ClientBootstrap;
|
||||
import org.jboss.netty.channel.*;
|
||||
import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
|
||||
@ -332,8 +331,9 @@ public class PeerGroup {
|
||||
running = true;
|
||||
this.peerGroupThread.start();
|
||||
}
|
||||
|
||||
void mockStart(PeerGroupThread peerGroupThread) {
|
||||
|
||||
// Visible for testing.
|
||||
synchronized void mockStart(PeerGroupThread peerGroupThread) {
|
||||
this.peerGroupThread = peerGroupThread;
|
||||
running = true;
|
||||
}
|
||||
@ -362,7 +362,7 @@ public class PeerGroup {
|
||||
*
|
||||
* @return a Future that can be used to wait for the async broadcast to complete.
|
||||
*/
|
||||
public Future<Transaction> broadcastTransaction(final Transaction tx) {
|
||||
public synchronized Future<Transaction> broadcastTransaction(final Transaction tx) {
|
||||
FutureTask<Transaction> future = new FutureTask<Transaction>(new Runnable() {
|
||||
public void run() {
|
||||
// This is run with the peer group already locked.
|
||||
|
@ -16,18 +16,6 @@
|
||||
|
||||
package com.google.bitcoin.examples;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.jboss.netty.bootstrap.ClientBootstrap;
|
||||
import org.jboss.netty.channel.*;
|
||||
import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
|
||||
|
||||
import com.google.bitcoin.core.Message;
|
||||
import com.google.bitcoin.core.NetworkParameters;
|
||||
import com.google.bitcoin.core.TCPNetworkConnection;
|
||||
@ -35,6 +23,17 @@ import com.google.bitcoin.core.VersionMessage;
|
||||
import com.google.bitcoin.discovery.DnsDiscovery;
|
||||
import com.google.bitcoin.discovery.IrcDiscovery;
|
||||
import com.google.bitcoin.discovery.PeerDiscoveryException;
|
||||
import org.jboss.netty.bootstrap.ClientBootstrap;
|
||||
import org.jboss.netty.channel.*;
|
||||
import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Prints a list of IP addresses connected to the rendezvous point on the LFnet IRC channel.
|
||||
@ -110,7 +109,7 @@ public class PrintPeers {
|
||||
|
||||
TCPNetworkConnection conn =
|
||||
new TCPNetworkConnection(params, new VersionMessage(params, 0));
|
||||
pipeline.addLast("codec", conn);
|
||||
pipeline.addLast("codec", conn.getHandler());
|
||||
pipeline.addLast("peer", new SimpleChannelHandler() {
|
||||
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
|
||||
Message m = (Message)e.getMessage();
|
||||
|
Loading…
Reference in New Issue
Block a user