mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
channeld: don't ever send back-to-back feerate changes.
There are several reports of desynchronization with LND here; a simple approach is to only have one feerate change in flight at any time. Even if this turns out to be our fault, it's been a historic area of confusion, so this restriction seems reasonable. Changelog-Fixed: Protocol: Don't create more than one feerate change at a time, as this seems to desync with LND. Fixes: #4152 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -73,6 +73,16 @@ u32 get_feerate(const struct fee_states *fee_states,
|
||||
abort();
|
||||
}
|
||||
|
||||
/* Are feerates all agreed by both sides? */
|
||||
bool feerate_changes_done(const struct fee_states *fee_states)
|
||||
{
|
||||
size_t num_feerates = 0;
|
||||
for (size_t i = 0; i < ARRAY_SIZE(fee_states->feerate); i++) {
|
||||
num_feerates += (fee_states->feerate[i] != NULL);
|
||||
}
|
||||
return num_feerates == 1;
|
||||
}
|
||||
|
||||
void start_fee_update(struct fee_states *fee_states,
|
||||
enum side opener,
|
||||
u32 feerate_per_kw)
|
||||
|
||||
Reference in New Issue
Block a user