Commit b0218a4
committed
Cache peers in Flow
In upcoming commits, we'll move to creating multi-hop blinded paths during the
process of creating a revoke_and_ack message within the Channel struct. These
paths will be included in said RAA to be used as reply paths for often-offline
senders held_htlc_available messages.
Because we hold the per-peer lock corresponding to the Channel while creating
this RAA, we can't use our typical approach of calling
ChannelManager::get_peers_for_blinded_path to create these blinded paths.
The ::get_peers method takes each peer's lock in turn in order to check for
usable channels/onion message feature support, and it's not permitted to hold
multiple peer state locks at the same time due to the potential for deadlocks
(see the debug_sync module).
To avoid taking other peer state locks while holding a particular Channel's
peer state lock, here we cache the set of peers in the OffersMessageFlow, which
is the struct that ultimately creates the blinded paths for the RAA.1 parent c2e3ae0 commit b0218a4
2 files changed
+25
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8077 | 8077 | | |
8078 | 8078 | | |
8079 | 8079 | | |
| 8080 | + | |
| 8081 | + | |
8080 | 8082 | | |
8081 | 8083 | | |
8082 | 8084 | | |
| |||
10427 | 10429 | | |
10428 | 10430 | | |
10429 | 10431 | | |
10430 | | - | |
10431 | 10432 | | |
10432 | 10433 | | |
10433 | 10434 | | |
10434 | 10435 | | |
10435 | 10436 | | |
10436 | 10437 | | |
10437 | | - | |
| 10438 | + | |
10438 | 10439 | | |
10439 | 10440 | | |
| 10441 | + | |
| 10442 | + | |
| 10443 | + | |
| 10444 | + | |
| 10445 | + | |
10440 | 10446 | | |
10441 | 10447 | | |
10442 | 10448 | | |
| |||
10530 | 10536 | | |
10531 | 10537 | | |
10532 | 10538 | | |
| 10539 | + | |
10533 | 10540 | | |
10534 | 10541 | | |
10535 | 10542 | | |
| |||
13391 | 13398 | | |
13392 | 13399 | | |
13393 | 13400 | | |
| 13401 | + | |
| 13402 | + | |
13394 | 13403 | | |
13395 | 13404 | | |
13396 | 13405 | | |
| |||
13503 | 13512 | | |
13504 | 13513 | | |
13505 | 13514 | | |
| 13515 | + | |
13506 | 13516 | | |
13507 | 13517 | | |
13508 | 13518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| |||
1739 | 1741 | | |
1740 | 1742 | | |
1741 | 1743 | | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
1742 | 1755 | | |
0 commit comments