diff --git a/core/src/main/java/com/google/bitcoin/protocols/channels/PaymentChannelServerState.java b/core/src/main/java/com/google/bitcoin/protocols/channels/PaymentChannelServerState.java
index 68e01485..df1996e2 100644
--- a/core/src/main/java/com/google/bitcoin/protocols/channels/PaymentChannelServerState.java
+++ b/core/src/main/java/com/google/bitcoin/protocols/channels/PaymentChannelServerState.java
@@ -376,13 +376,16 @@ public class PaymentChannelServerState {
closedFuture.set(this);
return closedFuture;
}
- if (state != State.READY) // We are already closing/closed/in an error state
+ if (state != State.READY) {
+ log.warn("Failed attempt to close a channel in state " + state);
return closedFuture;
+ }
if (bestValueToMe.equals(BigInteger.ZERO)) {
// TODO: This is bogus. We shouldn't allow the client to get into this state (where they open and close
// a channel without sending us any money). We should either send an error at this point, or require
// the submission of an initial zero-valued payment during the open phase.
+ log.warn("Closing channel that never received any payments.");
state = State.CLOSED;
closedFuture.set(this);
return closedFuture;
diff --git a/core/src/main/java/com/google/bitcoin/protocols/channels/StoredPaymentChannelServerStates.java b/core/src/main/java/com/google/bitcoin/protocols/channels/StoredPaymentChannelServerStates.java
index 1184dfd6..7199ebaf 100644
--- a/core/src/main/java/com/google/bitcoin/protocols/channels/StoredPaymentChannelServerStates.java
+++ b/core/src/main/java/com/google/bitcoin/protocols/channels/StoredPaymentChannelServerStates.java
@@ -21,6 +21,7 @@ import com.google.bitcoin.utils.Threading;
import com.google.common.annotations.VisibleForTesting;
import com.google.protobuf.ByteString;
import net.jcip.annotations.GuardedBy;
+import org.slf4j.LoggerFactory;
import java.math.BigInteger;
import java.util.*;
@@ -33,6 +34,8 @@ import static com.google.common.base.Preconditions.*;
* unlock.
*/
public class StoredPaymentChannelServerStates implements WalletExtension {
+ private static final org.slf4j.Logger log = LoggerFactory.getLogger(StoredPaymentChannelServerStates.class);
+
static final String EXTENSION_ID = StoredPaymentChannelServerStates.class.getName();
@GuardedBy("lock") @VisibleForTesting final Map