BOLT#7 requires that nodes "SHOULD accept HTLCs that pay a fee equal to or greater than:
fee_base_msat + ( amount_to_forward * fee_proportional_millionths / 1000000 )".
The code in rebalance.py:setup_routing_fees was not strictly meeting the above requirement, as it was using truncating integer division to calculate the proportional part of the fee, which typically results in a fee that is strictly less than the theoretical, infinite-precision, required fee. Some node implementations may allow rounding down here, but some do not, resulting in sporadic WIRE_FEE_INSUFFICIENT errors.
This commit changes the fee calculation in setup_routing_fees so that it always rounds up to the next whole millisatoshi, thereby eliminating many WIRE_FEE_INSUFFICIENT errors and improving the success rate of the rebalance command.
This will set the correct `direction` on manual route hops (in/out).
Before this was not set, resulting in WIRE_FEE_INSUFFICIENT errors,
if fee was calcualted inconsistently with `direction`.
* doc: cleanup and key-value for optional parameters
* rebalance: cleanup and refinements
* sendinvoiceless: cleanup and refinements
* summary: reflects upcoming changes of pylightning to_approx_str
* rebalance: check peer connection on local channels
The channel selection query didnt filter for channels not
having a short_channel_id yet (unconfirmed ones).
This lead to a KeyError whenever an unconfirmed channel existed.