mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +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:
committed by
Rusty Russell
parent
674d176087
commit
94e42f2384
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user