Fix: After sending onchain payment the balance doesn’t refresh immediately
Reproduce:
- sent onchain payment and tapped “Done” to go back to main screen, but then the on-chain balance did not update to reflect that sent transaction
- i killed the app and then opened it and the on-chain balance reflected the transaction
This may be something onchain specific w LDK Node, I don’t believe this happens with lightning.
Good catch. Agree most likely it's something to do with delayed node update. We could perhaps force one manually by getting .balances
My possibly incorrect remembering of how LDK Node handles onchain is that it checks every minute for a new balance, so in Monday when that check happens it will then update the onchain balance. But that check doesn't happen immediately after a payment, so the user will wait until that check happens to see the onchain balance refreshed.
I think I remember seeing this because that's why I used to have the time when it was last refreshed (via LDK Node api) under the balance, so I could visually see the time it was last refreshed.
This is my vague and old recollection of things though, could be completely off base, and just adding it here in case it helps explain this, but also more importantly need to dig in to see what the exact behavior is on LDK Node side.
https://github.com/lightningdevkit/ldk-node/blob/main/src/config.rs#L27 I think its 80 seconds actually ?
opened a pr #222 to try to address this