3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 14:54:15 +00:00

Payment channels: Expose a client connection method that terminates the TCP connection but doesn't try to close the channel (ask the server to broadcast the contract).

This commit is contained in:
Mike Hearn 2013-07-19 12:05:00 +02:00
parent a7dbe7cd03
commit 516327289f

View File

@ -105,7 +105,7 @@ public class PaymentChannelClientConnection {
}, Protos.TwoWayChannelMessage.getDefaultInstance(), Short.MAX_VALUE, timeoutSeconds*1000); }, Protos.TwoWayChannelMessage.getDefaultInstance(), Short.MAX_VALUE, timeoutSeconds*1000);
// Initiate the outbound network connection. We don't need to keep this around. The wireParser object will handle // Initiate the outbound network connection. We don't need to keep this around. The wireParser object will handle
// things from here on our. // things from here on out.
new ProtobufClient(server, wireParser, timeoutSeconds * 1000); new ProtobufClient(server, wireParser, timeoutSeconds * 1000);
} }
@ -163,4 +163,12 @@ public class PaymentChannelClientConnection {
// Already closed...oh well // Already closed...oh well
} }
} }
/**
* Disconnects the network connection but doesn't request the server to close the channel first (literally just
* unplugs the network socket and marks the stored channel state as inactive).
*/
public void disconnectWithoutChannelClose() {
wireParser.closeConnection();
}
} }