PR-C: web_server retype to core::coin::ICoinNode + set_coin_node wiring (btc smoke green)#80
Merged
Merged
Conversation
…dalone" This reverts commit ad05cc0.
web_server is SHARED core but held raw pointers to CONCRETE impl/ltc types (ltc::coin::NodeRPC, ltc::interfaces::Node, ltc::coin::CoinNodeInterface), which left undefined ltc:: coin-RPC symbols (NodeRPC::getwork/submit_block_hex) in the BTC link and kept btc smoke red. Collapse the three concrete pointers + two setters (set_coin_rpc / set_embedded_node) in both MiningInterface and WebServer into a single core::coin::ICoinNode* + set_coin_node(). The concrete per-coin node (ltc::coin::CoinNode / btc::coin::CoinNode) now makes the embedded-vs-rpc decision coin-side and crosses the seam only via get_work_view() (agnostic WorkView slice), submit_block_hex() (2-arg, no mweb), is_embedded() and has_rpc(). Full per-coin WorkData (incl. m_txs) never leaves the coin. No behavior change: refresh_work() keeps local wd (now a WorkView with the same m_data/m_hashes/m_latency fields), submit path splits on has_rpc()/ is_embedded(), source labels + status JSON keys preserved, and the WebServer initial-template-fetch timer stays rpc-only via has_rpc(). Pairs with the reverted de-scope (574e2444) that re-wires the set_coin_node callers in c2pool_refactored.cpp.
…tors
web_server retype removed the coin-node coupling, but c2pool-btc still links the ltc OBJECT lib for web_server share-message/config symbols (later-B-phase decouple). That pulls in ltc protocol handlers needing ltc::coin::{Mutable,}Transaction ctors, which live in ltc_coin. c2pool/c2pool_enhanced already link ltc_coin; mirror that for c2pool-btc. btc-target-only.
web_server retype (d1012a4) renamed the production seam MiningInterface::set_embedded_node(CoinNodeInterface*) -> set_coin_node(core::coin::ICoinNode*). The phase4 test callers still named the old API and passed a CoinNodeInterface mock, breaking the Linux x86_64 test-suite build. Wrap the existing CoinNodeInterface mock/embedded node in the production ltc::coin::CoinNode adapter (the concrete ICoinNode) exactly as c2pool_refactored.cpp:1984/1990 does, then call set_coin_node. The adapter funnels getwork() through get_work_view(), so each test template (height=1 mock / chain.height()+1 live) is byte-for-byte preserved. Pure API-rename migration; test intent unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Final red-to-green step for btc smoke (also unblocks #75/#77).
What
Retypes the web_server coin-node seam to
core::coin::ICoinNodeand restores the set_coin_node wiring de-scoped from PR-A.Commits
Verification
make c2pool-btc→ EXIT=0, 100%% Built target (was RED at LINK on undef ltc::coin::MutableTransaction ctors before commit 3).Note: residual web_server ltc share-message/config refs remain (later-B-phase decouple); c2pool-btc still links ltc by design for those.