diff --git a/backends/LND.ts b/backends/LND.ts index 754355f04..ac4476d13 100644 --- a/backends/LND.ts +++ b/backends/LND.ts @@ -253,10 +253,14 @@ export default class LND { this.getRequest(`/v1/graph/node/${urlParams && urlParams[0]}`); getFees = () => this.getRequest('/v1/fees'); setFees = (data: any) => { + // handle commas in place of decimals + const base_fee_msat = data.base_fee_msat.replace(/,/g, '.'); + const fee_rate = data.fee_rate.replace(/,/g, '.'); + if (data.global) { return this.postRequest('/v1/chanpolicy', { - base_fee_msat: data.base_fee_msat, - fee_rate: `${Number(data.fee_rate) / 100}`, + base_fee_msat, + fee_rate: `${Number(fee_rate) / 100}`, global: true, time_lock_delta: Number(data.time_lock_delta), min_htlc_msat: data.min_htlc @@ -269,8 +273,8 @@ export default class LND { }); } return this.postRequest('/v1/chanpolicy', { - base_fee_msat: data.base_fee_msat, - fee_rate: `${Number(data.fee_rate) / 100}`, + base_fee_msat, + fee_rate: `${Number(fee_rate) / 100}`, chan_point: { funding_txid_str: data.chan_point.funding_txid_str, output_index: data.chan_point.output_index