Closed Kexkey closed 2 years ago
I found an example of the other way around in my terminal scrollback. Unfortunately that was on v0.10.0... if I can reproduce this case on v0.10.1, I'll add to this issue. (EDIT: see next comment)
kexkey@AlcodaZ-2 lnurl_cypherapp % docker exec -it 44b lightning-cli --lightning-dir=/.lightning paystatus lnbcrt5185530p1psjjjc2pp5vlecv5amfwul9f8vwrmjc8ycaqwyvld5t2672qweynkkrgpngvmsdq0v3jhxce38q6n2vcxqyjw5qcqp2sp56kaynnrmvtnqqts4yxjnv87rqya95xllweqm45dmew5pmcumgp5q9qy9qsqflhsnezxjph23xk8tq85uh50nwx4wr94ft8mpq5kv43zrxj8wqdskl7veqvnze42u85m6km6aq9zsg3sucut58r7zzxjtykuasmqmvcqgkxv9e
{
"pay": []
}
kexkey@AlcodaZ-2 lnurl_cypherapp % docker exec -it 44b lightning-cli --lightning-dir=/.lightning listpays lnbcrt5185530p1psjjjc2pp5vlecv5amfwul9f8vwrmjc8ycaqwyvld5t2672qweynkkrgpngvmsdq0v3jhxce38q6n2vcxqyjw5qcqp2sp56kaynnrmvtnqqts4yxjnv87rqya95xllweqm45dmew5pmcumgp5q9qy9qsqflhsnezxjph23xk8tq85uh50nwx4wr94ft8mpq5kv43zrxj8wqdskl7veqvnze42u85m6km6aq9zsg3sucut58r7zzxjtykuasmqmvcqgkxv9e
{
"pays": [
{
"bolt11": "lnbcrt5185530p1psjjjc2pp5vlecv5amfwul9f8vwrmjc8ycaqwyvld5t2672qweynkkrgpngvmsdq0v3jhxce38q6n2vcxqyjw5qcqp2sp56kaynnrmvtnqqts4yxjnv87rqya95xllweqm45dmew5pmcumgp5q9qy9qsqflhsnezxjph23xk8tq85uh50nwx4wr94ft8mpq5kv43zrxj8wqdskl7veqvnze42u85m6km6aq9zsg3sucut58r7zzxjtykuasmqmvcqgkxv9e",
"destination": "029b26c73b2c19ec9bdddeeec97c313670c96b6414ceacae0fb1b3502e490a6cbb",
"payment_hash": "67f38653bb4bb9f2a4ec70f72c1c98e81c467db45ab5e501d924ed61a0334337",
"status": "failed",
"created_at": 1630096140,
"amount_sent_msat": "0msat"
}
]
}
Here is a case on our production server running v0.10.1. I obfuscated some data because real date on mainnet.
prod:~$ dexec lightning lightning-cli --lightning-dir=/.lightning listpays lnbc8341[...]uck50y
{
"pays": [
{
"bolt11": "lnbc8341[...]uck50y",
"destination": "034[...]6fe",
"payment_hash": "cb4[...]268",
"status": "failed",
"created_at": 1631149603,
"amount_sent_msat": "0msat"
}
]
}
prod:~$ dexec lightning lightning-cli --lightning-dir=/.lightning paystatus lnbc8341[...]uck50y
{
"pay": []
}
prod:~$ dexec lightning lightning-cli --lightning-dir=/.lightning getinfo
{
"id": "020a1df50b701331a29782093210460b10eee0ac5ef6a01b9c51dff9b8fddf5fb0",
"alias": "bullbitcoin.com",
"color": "5140bf",
"num_peers": 118,
"num_pending_channels": 1,
"num_active_channels": 113,
"num_inactive_channels": 1,
"address": [
{
"type": "ipv4",
"address": "170.75.170.23",
"port": 9735
},
{
"type": "torv3",
"address": "bodtfyvzc5dkcoxmpd2gogg6eufm44vrdwow2vfsonc3mavjhsmb3hid.onion",
"port": 9735
}
],
"binding": [
{
"type": "ipv4",
"address": "0.0.0.0",
"port": 9735
}
],
"version": "v0.10.1",
"blockheight": 699813,
"network": "bitcoin",
"msatoshi_fees_collected": 34014091,
"fees_collected_msat": "34014091msat",
"lightning-dir": "/.lightning/bitcoin"
}
I think #4567 might fix this issue. The problem is that we were implicitly assuming that the parts are returned in order, and therefore were annotating only the first part with the metadata (annotating all parts with identical metadata can bloat the DB quite a bit). We would then extract the metadata from the first part, and accumulate the other parts.
Some change in the ordering, especially with postgres backends, could end up with this assumption being broken. We now order the listsendpays
result by id
, and we process them in the correct order in the listpays
call, so this should be fixed again.
Sorry for the inconvenience.
Description and details
Sometimes bolt11 payments show up with
paystatus
and not withlistpays
, and other times it's the other way around. I would expect both to return payment data whatever the status is.Below is an example of an empty
listpays
array and a validpaystatus
response. But I got other cases wherelistpays
was returning payment info andpaystatus
was returning an empty array.On instance1:
On instance2:
I want to know the status of the payment:
Not sure why I don't have anything here, let's try with paystatus...
Of course, when I reconnect the two instances, payment goes through. Then,
listpays
andpaystatus
both return data.getinfo for both instances