Given that Alice wants to pay Bob in the lightning network, Bob first creates an invoice (using the python api) for A as follows:
request = invoicesrpc.AddHoldInvoiceRequest(hash=r_hash, value=30000) response_hold_B_to_A = stub.AddHoldInvoice(request, metadata=[('macaroon', macaroon)])
and sent the payment request in response_hold_B_to_A to Alice.
Next, Alice sends the payment to Bob as follows:
request = routerrpc.SendPaymentRequest(payment_request="<bob_invoice>", timeout_seconds=10000) for resp in stub.SendPaymentV2(request, metadata=[('macaroon', macaroon)]): print(resp)
Let say after Alice sends the payment it will go offline, and Bob before the payment time expires releases its preimage of the invoice as follow:
request = invoicesrpc.SettleInvoiceMsg(preimage=r_preimage) response = stub.SettleInvoice(request, metadata=[('macaroon', macaroon)])
At this point, if Bob checks its channels by executing
request = lnrpc.ListChannelsRequest() then the htlc is gone and the channel is inactive and the channel balance is NOT updated; However, if Bob checks the status of the invoice by executing:
request = invoicesrpc.SubscribeSingleInvoiceRequest(r_hash=r_hash) for response in stub.SubscribeSingleInvoice(request, metadata=[('macaroon', macaroon)])
it shows that state of the payment is SETTLED.
Now if Bob closes the channel (forcefully) then the balance still not reflected.
In summary Bob's channel balance does not change even though he has done everything right. Can someone please explain what is happening here? and how can Bob get paid in this situation? Should he go on the blockchain with its preimage and if so how would it do it?