As requested by ctrlbreak on IRC: documenting here.
setchannelfee <short-chanid-or-peerid> <base> <ppm>That seems fairly doable. Anyone volunteering for this? I could start erliest in two weeks.
also another question: might it be reasonable to implement this as a plugin. In this way more hooks and events that people would eventually want to expose would have to be implemented in c-lightning
Hey, I think I can have a look at this. But it would be, besides isolating issue https://github.com/ElementsProject/lightning/pull/2321 , my first contribution here, so please don't expect me being fast :D
Started working on it: 7c5cdee682ff4a4bdc2d6ce0f590ae32e5cf18aa
@rustyrussell can you explain what "ppm" means in this context?
@m-schmoock i believe it means 'part per millionth' -- the total fee is a 'percent' of the amount routed, in millionths plus the base
Here is my workspace: https://github.com/ElementsProject/lightning/compare/master...m-schmoock:feerate-per-channel
I will add the API function setchannelfee tomorrow.
Hey, two quick questions:
fee_proportional_millionths / 1000000 but later in the code its fee_per_satoshi / 1000000. Is ppm == fee_per_satoshi or is the comment misleading?
- lightningd/lightningd.h line 43 Is there a reason why the config.fee_per_satoshi value is a signed integer?
That's probably a left-over from the old idea of allowing negative fees. We abandoned quite a while ago.
- lightningd/lightningd.h line 495ff the comment tells that the fee is calculated using
fee_proportional_millionths / 1000000but later in the code itsfee_per_satoshi / 1000000. Is ppm == fee_per_satoshi or is the comment misleading?
Proportional fee and fee_per_satoshi are the same (proportional refers to the number of satoshis transferred). Just a bit of inconsistent naming :wink:
Thx. Addressed the first issue by PR https://github.com/ElementsProject/lightning/pull/2336
Almost everything done: https://github.com/ElementsProject/lightning/pull/2342
Need a review and feedback
https://github.com/ElementsProject/lightning/pull/2342 is merged. This can be closed
Most helpful comment
@m-schmoock i believe it means 'part per millionth' -- the total fee is a 'percent' of the amount routed, in millionths plus the base