diff --git a/hosts/by-name/servo/services/cryptocurrencies/clightning-sane/clightning-sane b/hosts/by-name/servo/services/cryptocurrencies/clightning-sane/clightning-sane index e11c8055..62bb1313 100755 --- a/hosts/by-name/servo/services/cryptocurrencies/clightning-sane/clightning-sane +++ b/hosts/by-name/servo/services/cryptocurrencies/clightning-sane/clightning-sane @@ -109,20 +109,20 @@ class LocalChannel: self.peer_ch = rpc.peerchannel(self.scid, self.remote_peer) def __repr__(self) -> str: - return self.to_str(with_scid=True, with_bal_ratio=True, with_cost=True, with_ppm_out=True) + return self.to_str(with_scid=True, with_bal_ratio=True, with_cost=True, with_ppm_theirs=True) - def to_str(self, with_scid: bool=False, with_bal_msat: bool=False, with_bal_ratio: bool=False, with_cost:bool = False, with_ppm_out:bool = False, with_ppm_in:bool = False) -> str: + def to_str(self, with_scid: bool=False, with_bal_msat: bool=False, with_bal_ratio: bool=False, with_cost:bool = False, with_ppm_theirs:bool = False, with_ppm_mine:bool = False) -> str: base_flag = "*" if self.to_me is None or self.to_me["base_fee_millisatoshi"] != 0 else "" alias = f"({self.remote_alias}){base_flag}" scid = f" scid:{self.scid:>13}" if with_scid else "" bal = f" S:{int(self.sendable):11}/R:{int(self.receivable):11}" if with_bal_msat else "" ratio = f" MINE:{(100*self.send_ratio):>8.4f}%" if with_bal_ratio else "" cost = f" COST:{self.opportunity_cost_lent:>11}" if with_cost else "" - ppm_out = self.to_me["fee_per_millionth"] if self.to_me else "N/A" - ppm_out = f" PPM_TO:{ppm_out:>6}" if with_ppm_out else "" - ppm_in = self.from_me["fee_per_millionth"] if self.from_me else "N/A" - ppm_in = f" PPM_TO:{ppm_in:>6}" if with_ppm_in else "" - return f"channel{alias:30}{scid}{bal}{ratio}{cost}{ppm_out}{ppm_in}" + ppm_theirs = self.to_me["fee_per_millionth"] if self.to_me else "N/A" + ppm_theirs = f" PPM_THEIRS:{ppm_theirs:>6}" if with_ppm_theirs else "" + ppm_mine = self.from_me["fee_per_millionth"] if self.from_me else "N/A" + ppm_mine = f" PPM_MINE:{ppm_mine:>6}" if with_ppm_mine else "" + return f"channel{alias:30}{scid}{bal}{ratio}{cost}{ppm_theirs}{ppm_mine}" @property @@ -396,7 +396,7 @@ def show_status(rpc: RpcHelper, full: bool=False): """ for ch in rpc.rpc.listpeerchannels()["channels"]: ch = rpc.localchannel(ch["short_channel_id"]) - print(ch.to_str(with_scid=True, with_bal_ratio=True, with_cost=True, with_ppm_out=True, with_ppm_in=full)) + print(ch.to_str(with_scid=True, with_bal_ratio=True, with_cost=True, with_ppm_theirs=True, with_ppm_mine=full)) def main(): logging.basicConfig()