adrienemery / lnd-grpc-client

A python grpc client/async client for LND ⚡⚡⚡
MIT License
34 stars 20 forks source link

lookup_invoice is not returning with the expected format #23

Closed nickfarrow closed 3 years ago

nickfarrow commented 3 years ago

Not sure if this is an issue with lnd-grpc-client or lnd itself, (trying to find out),

When I call lookupinvoice with the lncli I get a response that includes fields I need:

"amt_paid": "0",
    "amt_paid_sat": "0",
    "amt_paid_msat": "0",
    "state": "CANCELED"

But when I run via lnd-grpc-client I get a different response that is missing these fields:

r_preimage: "\240\262.\331*\010\265&\257m\226\t\025\301_\2658\267\355X\343B8\213|\361!\005w\302\366\022"
r_hash: "\n\215P>\374\237\004\315\220\266\351\270h\036\337\227\271E\005\261\345\263]\376c\006\010C\322{m\221"
value: 2811
creation_date: 1610409561
payment_request: "lnbc28110n1p0leejepp5p2x4q0hunuzvmy9kaxuxs8klj7u52pd3uke4mlnrqcyy85nmdkgsdqqcqzpgsp5hs35l6s2rwttttuegvfy63mlle8ppp822w0akuh98024s5zq3hes9qyyssqfl5x349pqp2lahcc2aqa6d6epsazm4wysgtqmln59ywc6jc9tj0q44tsfkxsspgt64pscng4kwu5l2vp33gnzaauss69he5jpkqguzcp7v35tm"
expiry: 3600
cltv_expiry: 40
add_index: 163

How can I get a response that includes amount paid?

I tried generating my own rpc_pb2.py using protoc rpc.proto but even then I get a response that differs from lndcli

...
expiry: 3600
cltv_expiry: 40
add_index: 160
value_msat: 2825000
features {
  key: 9
  value {
    name: "tlv-onion"
    is_known: true
  }
}
features {
  key: 14
  value {
    name: "payment-addr"
    is_required: true
    is_known: true
  }
}
features {
  key: 17
  value {
    name: "multi-path-payments"
    is_known: true
  }
}

This looks closer but is still missing what I need. Is this perhaps an issue with lndrpc itself?

Any help would be greatly appreciated. Otherwise I'm going to have to use ssh and subprocesses...

nickfarrow commented 3 years ago

Closing this, these fields only show up once the invoice has been paid..... e.g. amt_paid, amt_paid_sat...

I don't think this ideal, should probably be set to 0 until payed. Probably an issue with the underlying RPC rather than this implementation?