Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XRP] Consider renaming channel.amount to channel.balance #17

Open
dappelt opened this issue Nov 29, 2017 · 3 comments
Open

[XRP] Consider renaming channel.amount to channel.balance #17

dappelt opened this issue Nov 29, 2017 · 3 comments

Comments

@dappelt
Copy link
Collaborator

dappelt commented Nov 29, 2017

The amount secured by the best claim is stored in channel.amount. However, in the context of XRP paychans, amount refers to the total funding in a channel and balance denotes how much was claimed out of the channel (see rippled and ripple-lib). To avoid confusions, it would be better to stick with the same terminology as rippled and ripple-lib.

@dappelt dappelt changed the title Consider renaming channel.amount to channel.balance [XRP] Consider renaming channel.amount to channel.balance Nov 29, 2017
@emschwartz
Copy link
Owner

My understanding of those two terms was basically the opposite (they're pretty poorly named).

From the rippled docs:

Amount (Optional) The amount of XRP, in drops, authorized by the Signature. This must match the amount in the signed message. This is the cumulative amount of XRP that can be dispensed by the channel, including XRP previously redeemed.

That sounds to me like it would be the amount secured by the best claim...

@sharafian
Copy link
Collaborator

In parameters of the payment channel creation, Amount is the total to set aside from the sender's funds (https://ripple.com/build/transactions/#paymentchannelcreate). When you fetch the ledger entry it's the Balance that contains how much has been claimed so far.

@dappelt
Copy link
Collaborator Author

dappelt commented Nov 30, 2017

In case the part "including XRP previously redeemed" is confusing to you, all that means is that amount will never be decreased during the lifespan of a channel. The channel amount starts at the amount indicated in the channel create transaction and can be increased by channel fund transactions. Claiming funds from the channel does not decrease the amount, but does increase the balance, hence if balance = amount all funds have been claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants