1- /*
1+ /* *
22 * Copyright (c) 2011-2015 libbitcoin developers (see AUTHORS)
33 *
44 * This file is part of libbitcoin-server.
2121#define LIBBITCOIN_SERVER_NODE_IMPL_HPP
2222
2323#include < bitcoin/node.hpp>
24+ #include < bitcoin/server/message.hpp>
25+ #include < bitcoin/server/service/util.hpp>
2426#include < bitcoin/server/settings.hpp>
2527
2628namespace libbitcoin {
2729namespace server {
2830
29- class node_impl
31+ class server_node
32+ /* : full_node */
3033{
3134public:
3235 typedef std::function<void (size_t , const bc::block_type&)>
3336 block_notify_callback;
3437 typedef std::function<void (const bc::transaction_type&)>
3538 transaction_notify_callback;
3639
37- node_impl (settings_type& config);
40+ server_node (settings_type& config);
3841 bool start (settings_type& config);
42+
3943 // Should only be called from the main thread.
4044 // It's an error to join() a thread from inside it.
4145 bool stop ();
@@ -52,6 +56,10 @@ class node_impl
5256 // Threadpool for memory related operations.
5357 bc::threadpool& memory_related_threadpool ();
5458
59+ // TODO: use existing libbitcoin-node implementation.
60+ static void fullnode_fetch_history (server_node& node,
61+ const incoming_message& request, queue_send_callback queue_send);
62+
5563private:
5664 typedef std::vector<block_notify_callback> block_notify_list;
5765 typedef std::vector<transaction_notify_callback> transaction_notify_list;
@@ -67,12 +75,11 @@ class node_impl
6775 void recv_transaction (const std::error_code& ec,
6876 const bc::transaction_type& tx, bc::network::channel_ptr node);
6977 // Result of store operation in transaction pool.
70- void handle_mempool_store (
71- const std::error_code& ec , const bc::index_list& unconfirmed ,
72- const bc::transaction_type& tx, bc::network::channel_ptr node);
78+ void handle_mempool_store (const std::error_code& ec,
79+ const bc::index_list& unconfirmed , const bc::transaction_type& tx ,
80+ bc::network::channel_ptr node);
7381
74- void reorganize (const std::error_code& ec,
75- size_t fork_point,
82+ void reorganize (const std::error_code& ec, size_t fork_point,
7683 const bc::chain::blockchain::block_list& new_blocks,
7784 const bc::chain::blockchain::block_list& replaced_blocks);
7885
@@ -99,5 +106,6 @@ class node_impl
99106} // namespace server
100107} // namespace libbitcoin
101108
109+
102110#endif
103111
0 commit comments