mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
gossipd: clean up local channel updates.
Make update_local_channel use a timer if it's too soon to make another update. 1. Implement cupdate_different() which compares two updates. 2. make update_local_channel() take a single arg for timer usage. 3. Set timestamp of non-disable update back 5 minutes, so we can always generate a disable update if we need to. 4. Make update_local_channel() itself do the "unchanged update" suppression. gossipd: clean up local channel updates. 5. Keep pointer to the current timer so we override any old updates with a new one, to avoid a race. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -66,6 +66,9 @@ struct local_chan {
|
||||
|
||||
/* We soft-disable local channels when a peer disconnects */
|
||||
bool local_disabled;
|
||||
|
||||
/* Timer if we're deferring an update. */
|
||||
struct oneshot *channel_update_timer;
|
||||
};
|
||||
|
||||
/* Use this instead of tal_free(chan)! */
|
||||
|
||||
Reference in New Issue
Block a user