log.warn("{}: Payment channel terminating with reason {}", socket, reason);
if (reason == PaymentChannelCloseException.CloseReason.SERVER_REQUESTED_TOO_MUCH_VALUE) {
future.completeExceptionally(new InsufficientMoneyException(paymentChannelClient.getMissing()));
} else {
if (currentFuture != null)
currentFuture.completeExceptionally(new PaymentChannelCloseException("Unexpected payment channel termination", reason));
}
} else {
checkState(settling);
log.info("{}: Payment channel settled successfully.", socket);
settlementFuture.complete(null);