We don't immediately disable, to avoid flapping. */
| 868 | |
| 869 | /* We don't immediately disable, to avoid flapping. */ |
| 870 | void local_disable_chan(struct daemon *daemon, const struct chan *chan, int direction) |
| 871 | { |
| 872 | struct deferred_update *du; |
| 873 | u8 *update = prev_update(tmpctx, daemon, chan, direction); |
| 874 | if (!update) |
| 875 | return; |
| 876 | |
| 877 | du = find_deferred_update(daemon, chan); |
| 878 | |
| 879 | /* Will a deferred update disable it already? OK, nothing to do. */ |
| 880 | if (du && is_disabled(du->update)) |
| 881 | return; |
| 882 | |
| 883 | /* OK, we definitely don't want deferred update to re-enable! */ |
| 884 | tal_free(du); |
| 885 | |
| 886 | /* Is it already disabled? */ |
| 887 | if (is_disabled(update)) |
| 888 | return; |
| 889 | |
| 890 | /* This is deferred indefinitely (flushed if needed though) */ |
| 891 | set_disable_flag(update, true); |
| 892 | defer_update(daemon, 0xFFFFFFFF, chan, direction, take(update)); |
| 893 | } |
| 894 | |
| 895 | /* lightningd tells us it used the local channel update. */ |
| 896 | void handle_used_local_channel_update(struct daemon *daemon, const u8 *msg) |
no test coverage detected