• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

libbitcoin / libbitcoin-node / 44690193668

20 Nov 2026 06:46AM UTC coverage: 90.659% (-0.2%) from 90.883%
44690193668

push

github

web-flow
Merge pull request #1275 from evoskuil/master

Refactor sources, remove dead code, regen, style.

2 of 2 new or added lines in 1 file covered. (100.0%)

206 existing lines in 12 files now uncovered.

4523 of 4989 relevant lines covered (90.66%)

4834.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.69
/src/sessions/session.cpp
1
/**
2
 * Copyright (c) 2011-2026 libbitcoin developers
3
 *
4
 * This file is part of libbitcoin.
5
 *
6
 * This program is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU Affero General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU Affero General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Affero General Public License
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 */
19
#include <bitcoin/node/sessions/session.hpp>
20

21
#include <bitcoin/node/configuration.hpp>
22
#include <bitcoin/node/define.hpp>
23
#include <bitcoin/node/full_node.hpp>
24

25
namespace libbitcoin {
26
namespace node {
27

28
using namespace system::chain;
29
using namespace database;
30
using namespace network;
31

32
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
33

34
session::session(full_node& node) NOEXCEPT
1,326 ✔
35
  : node_(node)
1,326 ✔
36
{
37
}
1,326 ✔
38

39
// Organizers.
40
// ----------------------------------------------------------------------------
41

42
void session::organize(const header::cptr& header,
2 ✔
43
    organize_handler&& handler) NOEXCEPT
44
{
45
    node_.organize(header, std::move(handler));
2 ✔
46
}
2 ✔
47

48
void session::organize(const header::cptr& header, bool milestone,
6,011 ✔
49
    organize_handler&& handler) NOEXCEPT
50
{
51
    node_.organize(header, milestone, std::move(handler));
6,011 ✔
52
}
6,011 ✔
53

54
void session::organize_compact(const header::cptr& header,
10 ✔
55
    organize_handler&& handler) NOEXCEPT
56
{
57
    node_.organize_compact(header, std::move(handler));
10 ✔
58
}
10 ✔
59

60
void session::prioritize(const hash_digest& hash,
2 ✔
61
    organize_handler&& handler) NOEXCEPT
62
{
63
    node_.prioritize(hash, std::move(handler));
2 ✔
64
}
2 ✔
65

66
void session::submit(const transactions_cptr& txs, bool test,
1 ✔
67
    submit_handler&& handler) NOEXCEPT
68
{
69
    node_.submit(txs, test, std::move(handler));
1 ✔
70
}
1 ✔
71

72
void session::submit_announced(const transactions_cptr& txs,
25 ✔
73
    submit_handler&& handler) NOEXCEPT
74
{
75
    node_.submit_announced(txs, std::move(handler));
25 ✔
76
}
25 ✔
77

78
void session::submit_compact(const transactions_cptr& txs,
4 ✔
79
    const database::tx_links& links, const database::header_link& link,
80
    submit_handler&& handler) NOEXCEPT
81
{
82
    node_.submit_compact(txs, links, link, std::move(handler));
4 ✔
83
}
4 ✔
84

85
bool session::archive_block(code& ec,
6 ✔
86
    const system::chain::view::block::cptr& block,
87
    const database::header_link& link, bool strong, bool bypass, size_t height,
88
    bool prune, network::result_handler&& handler) NOEXCEPT
89
{
90
    return node_.archive_block(ec, block, link, strong, bypass, height,
6 ✔
91
        prune, std::move(handler));
6 ✔
92
}
93

94
void session::get_minimum_work(work_handler&& handler) NOEXCEPT
77 ✔
95
{
96
    node_.get_minimum_work(std::move(handler));
77 ✔
97
}
77 ✔
98

99
void session::get_hashes(map_handler&& handler) NOEXCEPT
53 ✔
100
{
101
    node_.get_hashes(std::move(handler));
53 ✔
102
}
53 ✔
103

104
void session::put_hashes(const map_ptr& map,
27 ✔
105
    network::result_handler&& handler) NOEXCEPT
106
{
107
    node_.put_hashes(map, std::move(handler));
27 ✔
108
}
27 ✔
109

110
void session::get_unfilled(header_t link, map_handler&& handler) NOEXCEPT
5 ✔
111
{
112
    node_.get_unfilled(link, std::move(handler));
5 ✔
113
}
5 ✔
114

115
bool session::reserve_compact() NOEXCEPT
3 ✔
116
{
117
    return node_.reserve_compact();
3 ✔
118
}
119

120
void session::release_compact() NOEXCEPT
3 ✔
121
{
122
    node_.release_compact();
3 ✔
123
}
3 ✔
124

125
// Events.
126
// ----------------------------------------------------------------------------
127

128
void session::notify(const code& ec, event_value value) const NOEXCEPT
36 ✔
129
{
130
    node_.notify(ec, value);
36 ✔
131
}
36 ✔
132

133
void session::notify_one(object_key key, const code& ec,
1 ✔
134
    event_value value) const NOEXCEPT
135
{
136
    node_.notify_one(key, ec, value);
1 ✔
137
}
1 ✔
138

139
object_key session::subscribe_chase(event_notifier&& handler) NOEXCEPT
3 ✔
140
{
141
    return node_.subscribe_chase(std::move(handler));
3 ✔
142
}
143

144
void session::subscribe_chase(event_notifier&& handler,
488 ✔
145
    event_completer&& complete) NOEXCEPT
146
{
147
    node_.subscribe_chase(std::move(handler), std::move(complete));
488 ✔
148
}
488 ✔
149

150
void session::unsubscribe_chase(object_key key) NOEXCEPT
626 ✔
151
{
152
    node_.unsubscribe_chase(key);
626 ✔
153
}
626 ✔
154

155
// Methods.
156
// ----------------------------------------------------------------------------
157

UNCOV
158
void session::get_template(template_handler&& handler) NOEXCEPT
×
159
{
UNCOV
160
    node_.get_template(std::move(handler));
×
UNCOV
161
}
×
162

163
void session::estimate(size_t target, estimate_mode mode,
2 ✔
164
    estimate_handler&& handler) NOEXCEPT
165
{
166
    node_.estimate(target, mode, std::move(handler));
2 ✔
167
}
2 ✔
168

169
void session::get_confirmable_txs(confirmable_txs_handler&& handler) NOEXCEPT
5 ✔
170
{
171
    node_.get_confirmable_txs(std::move(handler));
5 ✔
172
}
5 ✔
173

UNCOV
174
void session::get_confirmable_fees(confirmable_fees_handler&& handler) NOEXCEPT
×
175
{
UNCOV
176
    node_.get_confirmable_fees(std::move(handler));
×
UNCOV
177
}
×
178

179
void session::performance(object_key key, uint64_t speed,
4 ✔
180
    result_handler&& handler) NOEXCEPT
181
{
182
    node_.performance(key, speed, std::move(handler));
4 ✔
183
}
4 ✔
184

185
// Suspensions.
186
// ----------------------------------------------------------------------------
187

188
void session::fault(const code& ec) NOEXCEPT
2 ✔
189
{
190
    node_.fault(ec);
2 ✔
191
}
2 ✔
192

193
// Properties.
194
// ----------------------------------------------------------------------------
195

196
full_node::query& session::archive() const NOEXCEPT
50,578 ✔
197
{
198
    return node_.archive();
50,578 ✔
199
}
200

201
const node::configuration& session::node_config() const NOEXCEPT
183 ✔
202
{
203
    return node_.node_config();
183 ✔
204
}
205

206
const system::settings& session::system_settings() const NOEXCEPT
100 ✔
207
{
208
    return node_.system_settings();
100 ✔
209
}
210

211
const database::settings& session::database_settings() const NOEXCEPT
5 ✔
212
{
213
    return node_.database_settings();
5 ✔
214
}
215

216
////const network::settings& session::network_settings() const NOEXCEPT
217
////{
218
////    return node_.network_settings();
219
////}
220

221
const node::settings& session::node_settings() const NOEXCEPT
2,343 ✔
222
{
223
    return node_.node_settings();
2,343 ✔
224
}
225

226
bool session::is_current_chain(bool confirmed) const NOEXCEPT
294 ✔
227
{
228
    return node_.is_current_chain(confirmed);
294 ✔
229
}
230

231
bool session::is_current_time(uint32_t timestamp) const NOEXCEPT
16 ✔
232
{
233
    return node_.is_current_time(timestamp);
16 ✔
234
}
235

236
bool session::is_recent() const NOEXCEPT
432 ✔
237
{
238
    return node_.is_recent();
432 ✔
239
}
240

241
time_t session::start_time() const NOEXCEPT
2 ✔
242
{
243
    return node_.start_time();
2 ✔
244
}
245

246
size_t session::channel_count() const NOEXCEPT
2 ✔
247
{
248
    return node_.channel_count();
2 ✔
249
}
250

251
size_t session::inbound_channel_count() const NOEXCEPT
2 ✔
252
{
253
    return node_.inbound_channel_count();
2 ✔
254
}
255

256
size_t session::address_count() const NOEXCEPT
2 ✔
257
{
258
    return node_.address_count();
2 ✔
259
}
260

261
void session::connect(const network::config::endpoint& endpoint) NOEXCEPT
2 ✔
262
{
263
    node_.connect(endpoint);
2 ✔
264
}
2 ✔
265

266
void session::connect(const network::config::endpoint& endpoint,
2 ✔
267
    network::net::channel_notifier&& handler) NOEXCEPT
268
{
269
    node_.connect(endpoint, std::move(handler));
2 ✔
270
}
2 ✔
271

272
bool session::suspended() const NOEXCEPT
6 ✔
273
{
274
    return node_.suspended();
6 ✔
275
}
276

277
void session::suspend(const code& ec) NOEXCEPT
2 ✔
278
{
279
    node_.suspend(ec);
2 ✔
280
}
2 ✔
281

282
bool session::resume() NOEXCEPT
2 ✔
283
{
284
    return node_.resume();
2 ✔
285
}
286

287
BC_POP_WARNING()
288

289
} // namespace node
290
} // namespace libbitcoin
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc