Commit 47ea351
pool: hoist ban/whitelist subsystem into pool::SharechainNode (kill node.cpp drift, slice 1) (#758)
node.cpp is copy-pasted across ltc/btc/bch/dgb. This introduces the
intermediate layer pool::SharechainNode<Config,ShareChain,Peer> between
pool::BaseNode and each coin's NodeImpl, and hoists the FIRST byte-identical,
coin-agnostic, non-consensus block into it: the peer ban-list + whitelist
subsystem.
Hoisted (verified byte-identical across all four coins, coin namespace aside):
is_banned, is_whitelisted, set_ban_duration, set_whitelist_path,
load_whitelist_from_disk, save_whitelist_to_disk,
admin_list_bans, admin_ban_ip, admin_unban_ip, admin_list_whitelist,
admin_whitelist_remove, and the build_bans_json/build_whitelist_json helpers,
plus the members m_ban_list, m_ip_ban_list, m_ban_duration,
m_whitelist_ips, m_whitelist_hosts, m_whitelist_path.
This slice is deliberately limited to the self-contained ban/whitelist surface:
every hoisted method touches ONLY members that move with it, so no dependent-base
qualification is needed and no consensus/sharechain-timing state is involved. The
bodies are relocated unchanged — pure de-duplication, behaviour identical.
The connection-coupled admin endpoints (admin_whitelist_add, admin_list_peers,
admin_drop_peer, admin_dial_peer) stay in NodeImpl for now: they reach into
BaseNode's connection maps and the outbound-dial members, so they belong to a
later slice that also hoists the outbound-connection manager.
DASH (still the 668-line skeleton, no ban/whitelist block yet) is untouched and
continues to derive from pool::BaseNode directly; it inherits this layer for free
once its node quick-wire lands and gives it the same block.
Net: -688 lines across the four coins, +243-line shared header (one source of
truth for four copies).
Regression evidence (this environment, system Boost/leveldb):
- c2pool-{ltc,btc,bch,dgb,dash} all build green.
- test_ltc_node: PASS.
- core_test: 56/56 PASS (incl. version-gate transition suite).
- ltc_pool_test harness constructs the node through the new base and enters the
run loop with no crash.
Co-authored-by: integrator <integrator@morisguide.com>1 parent f851c85 commit 47ea351
9 files changed
Lines changed: 259 additions & 688 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2175 | 2175 | | |
2176 | 2176 | | |
2177 | 2177 | | |
2178 | | - | |
2179 | | - | |
2180 | | - | |
2181 | | - | |
2182 | | - | |
2183 | | - | |
2184 | | - | |
2185 | 2178 | | |
2186 | | - | |
2187 | | - | |
2188 | | - | |
2189 | | - | |
2190 | | - | |
2191 | | - | |
2192 | | - | |
2193 | | - | |
2194 | | - | |
2195 | | - | |
2196 | | - | |
2197 | | - | |
2198 | | - | |
2199 | | - | |
2200 | 2179 | | |
2201 | 2180 | | |
2202 | 2181 | | |
2203 | | - | |
2204 | | - | |
2205 | | - | |
2206 | | - | |
2207 | | - | |
2208 | 2182 | | |
2209 | | - | |
2210 | | - | |
2211 | | - | |
2212 | | - | |
2213 | | - | |
2214 | | - | |
2215 | | - | |
2216 | | - | |
2217 | | - | |
2218 | | - | |
2219 | | - | |
2220 | | - | |
2221 | | - | |
2222 | | - | |
2223 | | - | |
2224 | | - | |
2225 | | - | |
2226 | | - | |
2227 | | - | |
2228 | | - | |
2229 | | - | |
2230 | | - | |
2231 | | - | |
2232 | 2183 | | |
2233 | | - | |
2234 | | - | |
2235 | | - | |
2236 | | - | |
2237 | | - | |
2238 | | - | |
2239 | | - | |
2240 | | - | |
2241 | | - | |
2242 | | - | |
2243 | | - | |
2244 | | - | |
2245 | | - | |
2246 | | - | |
2247 | | - | |
2248 | | - | |
2249 | | - | |
2250 | | - | |
2251 | | - | |
2252 | | - | |
2253 | | - | |
2254 | | - | |
2255 | | - | |
2256 | | - | |
2257 | | - | |
2258 | | - | |
2259 | | - | |
2260 | 2184 | | |
2261 | | - | |
2262 | | - | |
2263 | | - | |
2264 | | - | |
2265 | | - | |
2266 | | - | |
2267 | | - | |
2268 | | - | |
2269 | | - | |
2270 | | - | |
2271 | | - | |
2272 | | - | |
2273 | | - | |
2274 | | - | |
2275 | | - | |
2276 | | - | |
2277 | | - | |
2278 | | - | |
2279 | | - | |
2280 | | - | |
2281 | 2185 | | |
2282 | | - | |
2283 | | - | |
2284 | | - | |
2285 | | - | |
2286 | | - | |
2287 | | - | |
2288 | | - | |
2289 | 2186 | | |
2290 | | - | |
2291 | | - | |
2292 | | - | |
2293 | | - | |
2294 | 2187 | | |
2295 | | - | |
2296 | | - | |
2297 | | - | |
2298 | | - | |
2299 | | - | |
2300 | | - | |
2301 | | - | |
2302 | | - | |
2303 | | - | |
2304 | | - | |
2305 | | - | |
2306 | | - | |
2307 | 2188 | | |
2308 | | - | |
2309 | | - | |
2310 | | - | |
2311 | | - | |
2312 | | - | |
2313 | | - | |
2314 | | - | |
2315 | | - | |
2316 | | - | |
2317 | | - | |
2318 | | - | |
2319 | | - | |
2320 | | - | |
2321 | | - | |
2322 | 2189 | | |
2323 | | - | |
2324 | | - | |
2325 | | - | |
2326 | | - | |
2327 | 2190 | | |
2328 | 2191 | | |
2329 | 2192 | | |
| |||
2352 | 2215 | | |
2353 | 2216 | | |
2354 | 2217 | | |
2355 | | - | |
2356 | | - | |
2357 | | - | |
2358 | | - | |
2359 | | - | |
2360 | | - | |
2361 | | - | |
2362 | | - | |
2363 | | - | |
2364 | | - | |
2365 | | - | |
2366 | | - | |
2367 | | - | |
2368 | | - | |
2369 | | - | |
2370 | | - | |
2371 | | - | |
2372 | 2218 | | |
2373 | 2219 | | |
2374 | 2220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
| 57 | + | |
57 | 58 | | |
| 59 | + | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
592 | 595 | | |
593 | 596 | | |
594 | 597 | | |
595 | | - | |
596 | 598 | | |
597 | 599 | | |
598 | 600 | | |
| |||
681 | 683 | | |
682 | 684 | | |
683 | 685 | | |
684 | | - | |
685 | 686 | | |
686 | 687 | | |
687 | 688 | | |
688 | 689 | | |
689 | 690 | | |
690 | 691 | | |
691 | 692 | | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | 693 | | |
697 | | - | |
698 | 694 | | |
699 | 695 | | |
700 | 696 | | |
701 | 697 | | |
702 | 698 | | |
703 | 699 | | |
704 | | - | |
705 | 700 | | |
706 | 701 | | |
707 | | - | |
708 | 702 | | |
709 | 703 | | |
710 | 704 | | |
| |||
750 | 744 | | |
751 | 745 | | |
752 | 746 | | |
753 | | - | |
754 | | - | |
755 | 747 | | |
756 | 748 | | |
757 | 749 | | |
758 | | - | |
759 | 750 | | |
760 | 751 | | |
761 | 752 | | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | 753 | | |
766 | | - | |
767 | | - | |
768 | 754 | | |
769 | 755 | | |
770 | 756 | | |
| |||
0 commit comments