Skip to content

Commit

Permalink
Document the new argument of closeChannel()
Browse files Browse the repository at this point in the history
This follows the implementation change made in
raiden-network/raiden-contracts#1124

Now that anybody can call closeChannel() on behalf of the closing
party, the call now takes a signature of the closing party.
  • Loading branch information
pirapira committed Sep 3, 2019
1 parent 8c609dd commit 27b2e9e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions smart_contracts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,14 @@ Allows a channel participant to close the channel. The channel cannot be settled

function closeChannel(
uint256 channel_identifier,
address partner,
address non_closing_participant,
address closing_participant,
// The next four arguments form a balance proof.
bytes32 balance_hash,
uint256 nonce,
bytes32 additional_hash,
bytes signature
bytes memory non_closing_signature,
bytes memory closing_signature
)
public

Expand All @@ -514,7 +517,8 @@ Allows a channel participant to close the channel. The channel cannot be settled
- ``locksroot``: Hash of all pending locks for the partner.
- ``nonce``: Strictly monotonic value used to order transfers.
- ``additional_hash``: Computed from the message. Used for message authentication.
- ``signature``: Elliptic Curve 256k1 signature of the channel partner on the :term:`balance proof` data.
- ``non_closing_signature``: Elliptic Curve 256k1 signature of the channel partner on the :term:`balance proof` data.
- ``closing_signature``: Elliptic Curve 256k1 signature of the closing party on the :term:`balance proof update` data.
- ``closing_participant``: Ethereum address of the channel participant who calls this contract function.

.. Note::
Expand All @@ -524,6 +528,8 @@ Allows a channel participant to close the channel. The channel cannot be settled

Only a valid signed :term:`balance proof` from the channel ``partner`` ``MUST`` be accepted. This :term:`balance proof` sets the amount of tokens owed to the ``participant`` by the channel ``partner``.

Only a valid signed :term:`balance proof update` from the channel ``participant`` ``MUST`` be accepted. This signature on the :term:`balance proof update` (with message ID being ``1``) shows the intention of the ``participant`` to close the channel.

A ``participant`` ``MUST`` be able to close a channel regardless of his ``partner``'s availability (online/offline status).

.. _update-channel:
Expand Down

0 comments on commit 27b2e9e

Please sign in to comment.