itsneski / lightning-jet

Lightning Jet is a fully automated rebalancer for Lightning nodes. Jet optimizes channel liquidity allocation based on routing volume, missed routing opportunities (htlcs), and other variables.
MIT License
44 stars 11 forks source link

jet list-channels fails with a null error #66

Closed itsneski closed 2 years ago

itsneski commented 2 years ago
umbrel@umbrel:~/lightning-jet $ jet list-channels
node: 02ac613956d2df9e0f55ea5e420ab36e4ea9d66ee47dae08fbeffe30f511809012, error: Error: 5 NOT_FOUND: unable to find node
/home/umbrel/lightning-jet/api/list-channels.js:58
      pendingMap[i.node.pub_key] = i.node.alias;
                   ^

TypeError: Cannot read properties of null (reading 'node')
    at /home/umbrel/lightning-jet/api/list-channels.js:58:20
    at Array.forEach (<anonymous>)
    at listChannels (/home/umbrel/lightning-jet/api/list-channels.js:57:17)
    at /home/umbrel/lightning-jet/jet:393:19
    at new Promise (<anonymous>)
    at Command._action (/home/umbrel/lightning-jet/jet:390:12)
    at Command._run (/home/umbrel/lightning-jet/node_modules/caporal/lib/command.js:483:42)
    at Program._run (/home/umbrel/lightning-jet/node_modules/caporal/lib/program.js:183:16)
    at Program.parse (/home/umbrel/lightning-jet/node_modules/caporal/lib/program.js:289:17)
    at Object.<anonymous> (/home/umbrel/lightning-jet/jet:538:5)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47
umb
itsneski commented 2 years ago

lncli getnodeinfo returned empty for this peer.

itsneski commented 2 years ago

added extra null check to the code.