public class NativePaymentChannelServerConnectionEventHandler extends ServerConnectionEventHandler
Modifier and Type | Field and Description |
---|---|
long |
ptr |
Constructor and Description |
---|
NativePaymentChannelServerConnectionEventHandler() |
Modifier and Type | Method and Description |
---|---|
void |
channelClosed(PaymentChannelCloseException.CloseReason reason)
Called when the channel was closed for some reason.
|
void |
channelOpen(Sha256Hash channelId)
Triggered when the channel is opened and application messages/payments can begin
|
com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.ByteString> |
paymentIncrease(Coin by,
Coin to,
com.google.protobuf.ByteString info)
Called when the payment in this channel was successfully incremented by the client
|
closeChannel
public NativePaymentChannelServerConnectionEventHandler()
public void channelOpen(Sha256Hash channelId)
ServerConnectionEventHandler
channelOpen
in class ServerConnectionEventHandler
channelId
- A unique identifier which represents this channel (actually the hash of the multisig contract)public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.ByteString> paymentIncrease(Coin by, Coin to, com.google.protobuf.ByteString info)
ServerConnectionEventHandler
paymentIncrease
in class ServerConnectionEventHandler
by
- The increase in total paymentto
- The new total payment to us (not including fees which may be required to claim the payment)info
- Information about this payment increase, used to extend this protocol.public void channelClosed(PaymentChannelCloseException.CloseReason reason)
ServerConnectionEventHandler
Called when the channel was closed for some reason. May be called without a call to
ServerConnectionEventHandler.channelOpen(Sha256Hash)
.
Note that the same channel can be reopened at any point before it expires if the client reconnects and requests it.
channelClosed
in class ServerConnectionEventHandler