mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +01:00
openingd: prioritize incoming peer traffic over handling (and sending out) gossip
- reduces probability for a deadlock where we block on sending data because the other peer cannot receive because it blocks on sending data etc. - when either side sends so much data that it fills up the kernel/network buffer - however sending out gossip can still block when (malicious) peer never receives
This commit is contained in:
parent
674d176087
commit
94e42f2384
1 changed files with 3 additions and 2 deletions
|
@ -1157,10 +1157,11 @@ int main(int argc, char *argv[])
|
|||
* don't try to service more than one fd per loop. */
|
||||
if (pollfd[0].revents & POLLIN)
|
||||
msg = handle_master_in(state);
|
||||
else if (pollfd[1].revents & POLLIN)
|
||||
handle_gossip_in(state);
|
||||
else if (pollfd[2].revents & POLLIN)
|
||||
msg = handle_peer_in(state);
|
||||
else if (pollfd[1].revents & POLLIN)
|
||||
handle_gossip_in(state);
|
||||
|
||||
clean_tmpctx();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue