mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
For performance, we delay entering the 'wallet_payment' into the db until we actually commit to the HTLC (when we have to touch the DB anyway). This opens a race where we can try to pay twice, and since it's not in the database yet, we don't notice the duplicate. So remove the temporary payment field from htlc_out, which was always an uncomfortable hack, and make the wallet code abstract over the deferred entry a little by maintaining a 'unstored_payments' list and incorporating that in results. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>