fix: sendinvoiceless adds receivers fee

This commit is contained in:
Michael Schmoock
2019-05-07 16:55:20 +02:00
committed by Christian Decker
parent a35dfc5a5d
commit b515dbe59a

View File

@@ -17,10 +17,7 @@ def setup_routing_fees(plugin, route, msatoshi, payload):
fee = Millisatoshi(ch['base_fee_millisatoshi']) fee = Millisatoshi(ch['base_fee_millisatoshi'])
fee += msatoshi * ch['fee_per_millionth'] // 1000000 fee += msatoshi * ch['fee_per_millionth'] // 1000000
if ch['source'] == payload['nodeid']: if ch['source'] == payload['nodeid']:
if fee <= payload['msatoshi']: fee += payload['msatoshi']
fee = payload['msatoshi']
else:
raise RpcError("sendinvoiceless", payload, {'message': 'Insufficient sending amount'})
msatoshi += fee msatoshi += fee
delay += ch['delay'] delay += ch['delay']
r['direction'] = int(ch['channel_flags']) % 2 r['direction'] = int(ch['channel_flags']) % 2