prusnak / suez

Tool for pretty printing and optimizing Lightning Network channels.
GNU General Public License v3.0
78 stars 20 forks source link

TypeError: 'NoneType' object is not subscriptable #11

Closed deafboy closed 3 years ago

deafboy commented 3 years ago

This is what I get on my testnet LND instance with both python 3.6 and 3.7.

[bitcoin@lnd-tst suez]$ ./suez
Traceback (most recent call last):
  File "./suez", line 5, in <module>
    suez()
  File "/home/bitcoin/.local/lib/python3.6/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/home/bitcoin/.local/lib/python3.6/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/home/bitcoin/.local/lib/python3.6/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/bitcoin/.local/lib/python3.6/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/home/bitcoin/Download/src/suez/suez.py", line 53, in suez
    ln = clients[client](client_args)
  File "/home/bitcoin/Download/src/suez/lndclient.py", line 10, in __init__
    self.refresh()
  File "/home/bitcoin/Download/src/suez/lndclient.py", line 38, in refresh
    int(info["node1_policy"]["fee_base_msat"]),
TypeError: 'NoneType' object is not subscriptable
[bitcoin@lnd-tst suez]$

List of all the channels: http://transfer.sh/1MKZDnc/listchannels.txt

Fee report: http://transfer.sh/1WS7ZZL/feereport.txt

prusnak commented 3 years ago

Please try to apply this patch and run it again:

--- a/lndclient.py
+++ b/lndclient.py
@@ -33,6 +33,7 @@ class LndClient:
                 int(c["local_balance"]),
                 int(c["remote_balance"]),
             )
+            print("XXX", chan.chan_id)
             info = self._run("getchaninfo", chan.chan_id)
             node1_fee = (
                 int(info["node1_policy"]["fee_base_msat"]),

Look at the output and find the last line that looks like "XXX 71234945930938".

Cal then lncli getchaninfo 71234945930938 (where 7... is the number from above) and copy the result here.

Thanks!

deafboy commented 3 years ago
{
    "channel_id": "2017570851621109761",
    "chan_point": "bd11a2750787384f6bff052eaedaf5b7bb32102944489429439a7f86073e0b38:1",
    "last_update": 1600388350,
    "node1_pub": "02039cb8807f94ba55da2efabd9494db1dc076d6b32f4b2e0b06d8ee13d824d068",
    "node2_pub": "02651acf4a7096091bf42baad19b3643ea318d6979f6dcc16ebaec43d5b0f4baf2",
    "capacity": "1000000",
    "node1_policy": null,
    "node2_policy": {
        "time_lock_delta": 40,
        "min_htlc": "1000",
        "fee_base_msat": "1000",
        "fee_rate_milli_msat": "1",
        "disabled": false,
        "max_htlc_msat": "1000000000",
        "last_update": 1600388350
    }
}
prusnak commented 3 years ago

Fixed in https://github.com/prusnak/suez/commit/487724a980429396a0f63dd2fff87febabbdca65