Commit 75a4085
committed
Cache peers in OffersMessageFlow
In upcoming commits, we'll be creating 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 f8143cf commit 75a4085
2 files changed
+52
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13163 | 13163 | | |
13164 | 13164 | | |
13165 | 13165 | | |
| 13166 | + | |
| 13167 | + | |
13166 | 13168 | | |
13167 | 13169 | | |
13168 | 13170 | | |
| |||
13174 | 13176 | | |
13175 | 13177 | | |
13176 | 13178 | | |
13177 | | - | |
| 13179 | + | |
13178 | 13180 | | |
13179 | 13181 | | |
13180 | 13182 | | |
13181 | 13183 | | |
13182 | 13184 | | |
13183 | 13185 | | |
13184 | 13186 | | |
| 13187 | + | |
13185 | 13188 | | |
13186 | 13189 | | |
13187 | 13190 | | |
| |||
13208 | 13211 | | |
13209 | 13212 | | |
13210 | 13213 | | |
13211 | | - | |
13212 | 13214 | | |
13213 | 13215 | | |
13214 | 13216 | | |
| |||
13260 | 13262 | | |
13261 | 13263 | | |
13262 | 13264 | | |
| 13265 | + | |
| 13266 | + | |
| 13267 | + | |
| 13268 | + | |
| 13269 | + | |
13263 | 13270 | | |
13264 | 13271 | | |
13265 | 13272 | | |
| |||
13272 | 13279 | | |
13273 | 13280 | | |
13274 | 13281 | | |
| 13282 | + | |
13275 | 13283 | | |
13276 | 13284 | | |
13277 | 13285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
| |||
1683 | 1686 | | |
1684 | 1687 | | |
1685 | 1688 | | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
1686 | 1728 | | |
0 commit comments