Payment channels: Re-order c'tor of StoredPaymentChannelClientStates.

This makes it consistent with the server side and put the listener last. It's easier to read this way when an anonymous inner class is used.
This commit is contained in:
Mike Hearn
2013-07-19 13:03:35 +02:00
parent da0d6c37a2
commit 4f9bc98e97
4 changed files with 20 additions and 16 deletions

View File

@@ -16,21 +16,26 @@
package com.google.bitcoin.examples;
import java.io.File;
import java.math.BigInteger;
import java.net.InetSocketAddress;
import com.google.bitcoin.core.*;
import com.google.bitcoin.core.ECKey;
import com.google.bitcoin.core.NetworkParameters;
import com.google.bitcoin.core.Utils;
import com.google.bitcoin.core.Wallet;
import com.google.bitcoin.kits.WalletAppKit;
import com.google.bitcoin.params.TestNet3Params;
import com.google.bitcoin.protocols.channels.PaymentChannelClientConnection;
import com.google.bitcoin.protocols.channels.StoredPaymentChannelClientStates;
import com.google.bitcoin.protocols.channels.ValueOutOfRangeException;
import com.google.bitcoin.utils.BriefLogFormatter;
import com.google.common.util.concurrent.*;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.Uninterruptibles;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.math.BigInteger;
import java.net.InetSocketAddress;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
/**
@@ -65,7 +70,7 @@ public class ExamplePaymentChannelClient {
// The StoredPaymentChannelClientStates object is responsible for, amongst other things, broadcasting
// the refund transaction if its lock time has expired. It also persists channels so we can resume them
// after a restart.
wallet().addExtension(new StoredPaymentChannelClientStates(peerGroup(), wallet()));
wallet().addExtension(new StoredPaymentChannelClientStates(wallet(), peerGroup()));
}
};
appKit.startAndWait();