Commit 825c9e5
refactor(key-wallet): add
Five funds-only callsites in `wallet_info_interface.rs` were iterating
`all_accounts()` and filtering each ref via `as_funds()` / `as_funds_mut()`
inside the loop body — pure noise, since balance / UTXO state only ever
lives on Standard / CoinJoin / DashPay accounts.
Add focused accessors on `ManagedAccountCollection`:
- `all_funding_accounts(&self) -> Vec<&ManagedCoreFundsAccount>`
- `all_funding_accounts_mut(&mut self) -> Vec<&mut ManagedCoreFundsAccount>`
Migrate `account_balances`, `utxos`, `update_balance`, `immature_transactions`,
and `matured_coinbase_records` to use them. `monitored_addresses`,
`transaction_history`, `monitor_revision`, and `mark_instant_send_utxos`
keep using `all_accounts(_mut)` — they legitimately span both variants.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>all_funding_accounts(_mut) and drop in-loop as_funds() filters1 parent 1e7edbf commit 825c9e5
2 files changed
Lines changed: 44 additions & 33 deletions
File tree
- key-wallet/src
- managed_account
- wallet/managed_wallet_info
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1152 | 1152 | | |
1153 | 1153 | | |
1154 | 1154 | | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
1155 | 1183 | | |
1156 | 1184 | | |
1157 | 1185 | | |
| |||
Lines changed: 16 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 83 | + | |
87 | 84 | | |
88 | 85 | | |
89 | 86 | | |
| |||
196 | 193 | | |
197 | 194 | | |
198 | 195 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 196 | + | |
| 197 | + | |
203 | 198 | | |
204 | 199 | | |
205 | 200 | | |
| |||
215 | 210 | | |
216 | 211 | | |
217 | 212 | | |
| 213 | + | |
218 | 214 | | |
219 | 215 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
226 | 219 | | |
227 | 220 | | |
228 | 221 | | |
| |||
244 | 237 | | |
245 | 238 | | |
246 | 239 | | |
247 | | - | |
248 | | - | |
249 | 240 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
255 | 244 | | |
256 | 245 | | |
257 | 246 | | |
| |||
260 | 249 | | |
261 | 250 | | |
262 | 251 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
| 252 | + | |
| 253 | + | |
268 | 254 | | |
269 | 255 | | |
270 | 256 | | |
| |||
291 | 277 | | |
292 | 278 | | |
293 | 279 | | |
| 280 | + | |
294 | 281 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 282 | + | |
| 283 | + | |
301 | 284 | | |
302 | 285 | | |
303 | 286 | | |
| |||
0 commit comments