lightningj-org / lightningj

Core implementation of the lightningj API implementations.
http://www.lightningj.org
GNU Lesser General Public License v3.0
47 stars 11 forks source link

`QueryRoutes` always returns an empty route list #48

Closed champo closed 4 years ago

champo commented 4 years ago

Subject of the issue

The logs show that LND returned a correct response, but the response has an empty route list.

After some debugging, the method QueryRoutesReponse.populateRepeatedFields is being called by a log line inside SynchronousAPI.processResponse. That method is clearing the route list in the builder, and then repopulating it with whatever routes has but at this point in the responses lifetime, that variables hasn't been initialized yet. Moving the line that calls clearRoutes inside the if would fix the issue.

Your environment

Steps to reproduce

Call query routes for a known reachable destination

Expected behaviour

The routes should be parsed.

Actual behaviour

An empty list is returned.

herrvendil commented 4 years ago

Hi, I will look at this later today and see if I can reproduce it. I will include a fix into upcoming 0.8.2 release. I will get back.

herrvendil commented 4 years ago

Hi again, I have submitted a fix. The problem was that lists were cleared when converting to JSON incorrectly. It will be included in 0.8.2 released soon.

champo commented 4 years ago

@herrvendil thanks for the quick response! The fix looks good.