Commit 321d0fc
net: fix a few races. Credit @TheBlueMatt
These are (afaik) all long-standing races or concurrent accesses. Going
forward, we can clean these up so that they're not all individual atomic
accesses.
- Reintroduce cs_vRecv to guard receive-specific vars
- Lock vRecv/vSend for CNodeStats
- Make some vars atomic.
- Only set the connection time in CNode's constructor so that it doesn't change1 parent 2447c10 commit 321d0fc
3 files changed
+22
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
392 | | - | |
393 | 392 | | |
394 | 393 | | |
395 | 394 | | |
| |||
612 | 611 | | |
613 | 612 | | |
614 | 613 | | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
619 | 624 | | |
620 | 625 | | |
621 | 626 | | |
| |||
643 | 648 | | |
644 | 649 | | |
645 | 650 | | |
| 651 | + | |
646 | 652 | | |
647 | 653 | | |
648 | 654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
| 576 | + | |
576 | 577 | | |
577 | 578 | | |
578 | 579 | | |
| |||
584 | 585 | | |
585 | 586 | | |
586 | 587 | | |
587 | | - | |
588 | | - | |
| 588 | + | |
| 589 | + | |
589 | 590 | | |
590 | | - | |
| 591 | + | |
591 | 592 | | |
592 | 593 | | |
593 | 594 | | |
| |||
614 | 615 | | |
615 | 616 | | |
616 | 617 | | |
617 | | - | |
| 618 | + | |
618 | 619 | | |
619 | 620 | | |
620 | 621 | | |
| |||
665 | 666 | | |
666 | 667 | | |
667 | 668 | | |
668 | | - | |
| 669 | + | |
669 | 670 | | |
670 | | - | |
| 671 | + | |
671 | 672 | | |
672 | | - | |
| 673 | + | |
673 | 674 | | |
674 | | - | |
| 675 | + | |
675 | 676 | | |
676 | | - | |
| 677 | + | |
677 | 678 | | |
678 | 679 | | |
679 | 680 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2450 | 2450 | | |
2451 | 2451 | | |
2452 | 2452 | | |
2453 | | - | |
| 2453 | + | |
2454 | 2454 | | |
2455 | 2455 | | |
2456 | 2456 | | |
| |||
0 commit comments