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 stats shows incorrect channel id(s) #92

Closed smatison closed 1 year ago

smatison commented 1 year ago

Channel id(s) shown in the 'chan' column are incorrect. lncli getchaninfo returns [lncli] rpc error: code = Unknown desc = edge not found.

smatison commented 1 year ago

channel id(s) are stored in the db as INTEGERs. during conversion in javascript, the last two digits are rounded up, causing an incorrect channel id in the output. e.g.

802401595832598529 - correct channel id 802401595832598500 - incorrect channel id

to resolve this, cast INTEGERs into TEXT and avoid parseInt on the channel id to avoid rounding the last two digits.