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

libbitcoin / libbitcoin-server / 45530296317

25 Nov 2026 02:04AM UTC coverage: 93.825% (-0.07%) from 93.89%
45530296317

push

github

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

Add native headers and txs sets, strong and branch tops.

232 of 248 new or added lines in 5 files covered. (93.55%)

7 existing lines in 1 file now uncovered.

14464 of 15416 relevant lines covered (93.82%)

451.19 hits per line

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

92.45
/src/protocols/native/protocol_native_tx.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/server/protocols/protocol_native.hpp>
20

21
#include <atomic>
22
#include <bitcoin/server/define.hpp>
23

24
namespace libbitcoin {
25
namespace server {
26

27
using namespace system;
28
using namespace std::placeholders;
29

30
#define CLASS protocol_native
31

32
// The vsize of a fee histogram bin (electrs).
33
constexpr size_t histogram_bin = 50'000;
34

35
BC_PUSH_WARNING(NO_INCOMPLETE_SWITCH)
36
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
37

38
void protocol_native::handle_get_tx(const code& ec, interface::tx, uint8_t,
383 ✔
39
    uint8_t media, const hash_cptr& hash, bool witness) NOEXCEPT
40
{
41
    if (stopped(ec))
383 ✔
42
        return;
382 ✔
43

44
    const auto& query = archive();
9 ✔
45
    const auto link = query.to_tx(*hash);
9 ✔
46
    if (query.is_pruned(link))
9 ✔
47
    {
48
        send_not_found();
2 ✔
49
        return;
50
    }
51

52
    if (const auto tx = query.get_transaction(link, witness))
7 ✔
53
    {
54
        const auto size = tx->serialized_size(witness);
6 ✔
55
        switch (media)
6 ✔
56
        {
57
            case data:
4 ✔
58
                send_chunk(to_bin(*tx, size, witness));
4 ✔
59
                return;
4 ✔
60
            case text:
1 ✔
61
                send_text(to_hex(*tx, size, witness));
1 ✔
62
                return;
1 ✔
63
            case json:
1 ✔
64
                send_json(value_from(tx));
1 ✔
65
                return;
1 ✔
66
        }
67
    }
7 ✔
68

69
    send_not_found();
1 ✔
70
}
9 ✔
71

72
void protocol_native::handle_get_tx_header(const code& ec,
380 ✔
73
    interface::tx_header, uint8_t, uint8_t media,
74
    const hash_cptr& hash) NOEXCEPT
75
{
76
    if (stopped(ec))
380 ✔
77
        return;
380 ✔
78

79
    const auto& query = archive();
6 ✔
80
    const auto link = query.find_confirmed_block(*hash);
6 ✔
81
    if (link.is_terminal())
6 ✔
82
    {
83
        send_not_found();
2 ✔
84
        return;
85
    }
86

87
    const auto header = query.get_header(link);
4 ✔
88
    if (!header)
4 ✔
89
    {
90
        send_internal_server_error(database::error::integrity);
×
91
        return;
×
92
    }
93

94
    constexpr auto size = chain::header::serialized_size();
95
    switch (media)
4 ✔
96
    {
97
        case data:
2 ✔
98
            send_chunk(to_bin(*header, size));
2 ✔
99
            return;
2 ✔
100
        case text:
1 ✔
101
            send_text(to_hex(*header, size));
1 ✔
102
            return;
1 ✔
103
        case json:
1 ✔
104
            auto model = value_from(header);
1 ✔
105
            inject(model, {}, link);
1 ✔
106
            send_json(std::move(model));
1 ✔
107
            return;
108
    }
1 ✔
109

110
    send_not_found();
×
111
}
6 ✔
112

113
void protocol_native::handle_get_tx_details(const code& ec,
380 ✔
114
    interface::tx_details, uint8_t, uint8_t media,
115
    const hash_cptr& hash) NOEXCEPT
116
{
117
    if (stopped(ec))
380 ✔
118
        return;
378 ✔
119

120
    if (media != json)
6 ✔
121
    {
122
        send_not_acceptable();
1 ✔
123
        return;
1 ✔
124
    }
125

126
    const auto& query = archive();
5 ✔
127
    const auto link = query.to_tx(*hash);
5 ✔
128

129
    // Missing tx.
130
    if (link.is_terminal())
5 ✔
131
    {
132
        send_not_found();
1 ✔
133
        return;
134
    }
135

136
    uint64_t value{}, spend{};
4 ✔
137
    size_t nominal{}, maximal{};
4 ✔
138
    const auto coinbase = query.is_coinbase(link);
4 ✔
139
    if (!query.get_tx_sizes(nominal, maximal, link) ||
8 ✔
140
        !query.get_tx_value(value, link) ||
8 ✔
141
        !query.get_tx_spend(spend, link) ||
8 ✔
142
        (!coinbase && is_subtract_overflow(value, spend)))
4 ✔
143
    {
144
        send_internal_server_error(database::error::integrity);
1 ✔
145
        return;
1 ✔
146
    }
147

148
    // sigops and wtxid are not cached, so removed for now.
149
    system::json::object object
150
    {
151
        { "segregated", maximal != nominal },
6 ✔
152
        { "coinbase", coinbase },
153
        { "nominal", nominal },
154
        { "maximal", maximal },
155
        { "weight", chain::weighted_size(nominal, maximal) },
6 ✔
156
        { "virtual", chain::virtual_size(nominal, maximal) },
6 ✔
157
        { "value", value },
158
        { "spend", spend },
159
        { "fee", floored_subtract(value, spend) }
6 ✔
160
    };
3 ✔
161

162
    if (const auto block = query.find_strong(link); !block.is_terminal())
3 ✔
163
    {
164
        size_t position{};
2 ✔
165
        database::context context{};
2 ✔
166
        if (!query.get_context(context, block) ||
4 ✔
167
            !query.get_tx_position(position, link, block))
2 ✔
168
        {
169
            send_internal_server_error(database::error::integrity);
1 ✔
170
            return;
1 ✔
171
        }
172

173
        object["confirmed"] = system::json::object
2 ✔
174
        {
175
            { "height", context.height },
176
            { "position", position }
177
        };
1 ✔
178
    }
3 ✔
179

180
    send_json(std::move(object));
2 ✔
181
}
5 ✔
182

183
void protocol_native::handle_get_tx_subscribe(const code& ec,
378 ✔
184
    interface::tx_subscribe, uint8_t, uint8_t media, bool stop) NOEXCEPT
185
{
186
    if (stopped(ec))
378 ✔
187
        return;
188

189
    tx_subscribe_.store(to_media(stop, media), std::memory_order_relaxed);
4 ✔
190
    notify_empty();
4 ✔
191
}
192

193
// notify
194
void protocol_native::do_transaction(node::transaction_t link,
3 ✔
195
    media_type media) NOEXCEPT
196
{
197
    BC_ASSERT(stranded());
3 ✔
198

199
    const auto hash = archive().get_tx_key(link);
3 ✔
200
    switch (to_value(media))
3 ✔
201
    {
202
        case data:
1 ✔
203
            notify_chunk(to_chunk(hash));
1 ✔
204
            return;
3 ✔
205
        case text:
1 ✔
206
            notify_text(encode_base16(hash));
1 ✔
207
            return;
1 ✔
208
        case json:
1 ✔
209
            notify_json(value_from(encode_hash(hash)));
1 ✔
210
            return;
1 ✔
211
    }
212
}
213

214
void protocol_native::handle_get_template_subscribe(const code& ec,
378 ✔
215
    interface::template_subscribe, uint8_t, uint8_t media, bool stop) NOEXCEPT
216
{
217
    if (stopped(ec))
378 ✔
218
        return;
219

220
    // Templates are built for notification only while demanded.
221
    const auto prior = template_subscribe_.exchange(to_media(stop, media));
4 ✔
222
    if (prior == media_type::unknown && !stop)
4 ✔
223
        demand_template(true);
3 ✔
224
    else if (prior != media_type::unknown && stop)
1 ✔
225
        demand_template(false);
×
226

227
    notify_empty();
4 ✔
228
}
229

230
// notify
231
void protocol_native::do_template(node::height_t height,
3 ✔
232
    media_type media) NOEXCEPT
233
{
234
    BC_ASSERT(stranded());
3 ✔
235

236
    const auto value = possible_narrow_cast<uint32_t>(height);
3 ✔
237
    switch (to_value(media))
3 ✔
238
    {
239
        case data:
1 ✔
240
            notify_chunk(to_chunk(to_little_endian(value)));
1 ✔
241
            return;
1 ✔
242
        case text:
1 ✔
243
            notify_text(encode_base16(to_little_endian(value)));
1 ✔
244
            return;
1 ✔
245
        case json:
1 ✔
246
            notify_json(value);
1 ✔
247
            return;
1 ✔
248
    }
249
}
250

251
void protocol_native::handle_get_template(const code& ec,
381 ✔
252
    interface::template_, uint8_t, uint8_t media, uint32_t height) NOEXCEPT
253
{
254
    if (stopped(ec))
381 ✔
255
        return;
256

257
    if (media != json)
7 ✔
258
    {
259
        send_not_acceptable();
1 ✔
260
        return;
1 ✔
261
    }
262

263
    get_template_view(height, template_view::summary, media);
6 ✔
264
}
265

266
void protocol_native::handle_get_template_txs(const code& ec,
379 ✔
267
    interface::template_txs, uint8_t, uint8_t media, uint32_t height) NOEXCEPT
268
{
269
    if (stopped(ec))
379 ✔
270
        return;
271

272
    get_template_view(height, template_view::txs, media);
5 ✔
273
}
274

275
void protocol_native::handle_get_template_txs_details(const code& ec,
379 ✔
276
    interface::template_txs_details, uint8_t, uint8_t media,
277
    uint32_t height) NOEXCEPT
278
{
279
    if (stopped(ec))
379 ✔
280
        return;
281

282
    get_template_view(height, template_view::details, media);
5 ✔
283
}
284

285
// private
286
// Only the template of the next block is held.
287
void protocol_native::get_template_view(uint32_t height, template_view view,
16 ✔
288
    uint8_t media) NOEXCEPT
289
{
290
    if (add1(archive().get_top_confirmed()) != height)
16 ✔
291
    {
292
        send_not_found();
3 ✔
293
        return;
3 ✔
294
    }
295

296
    get_template(BIND(handle_template, _1, _2, height, view, media, gate()));
13 ✔
297
}
298

299
void protocol_native::handle_template(const code& ec,
13 ✔
300
    const node::block_template::cptr& held, uint32_t height,
301
    template_view view, uint8_t media, const gate_t::ptr& gate) NOEXCEPT
302
{
303
    POST(complete_get_template, ec, held, height, view, media, gate);
13 ✔
304
}
13 ✔
305

306
void protocol_native::complete_get_template(const code& ec,
13 ✔
307
    const node::block_template::cptr& held, uint32_t height,
308
    template_view view, uint8_t media, const gate_t::ptr& gate) NOEXCEPT
309
{
310
    BC_ASSERT(stranded());
13 ✔
311

312
    if (stopped())
13 ✔
313
        return;
314

315
    if (ec == node::error::pooling_disabled)
13 ✔
316
    {
317
        if (network_settings().enable_relay)
2 ✔
318
            send_service_unavailable();
1 ✔
319
        else
320
            send_not_implemented();
1 ✔
321

322
        return;
2 ✔
323
    }
324

325
    if (ec)
11 ✔
326
    {
327
        send_internal_server_error(ec);
×
328
        return;
×
329
    }
330

331
    // A template held for another height is of a chain that has since moved.
332
    if (held->context.height != height)
11 ✔
333
    {
334
        if (add1(archive().get_top_confirmed()) == height)
×
335
            get_template(BIND(handle_template, _1, _2, height, view, media,
×
336
                gate));
337
        else
338
            send_not_found();
×
339

340
        return;
×
341
    }
342

343
    switch (view)
11 ✔
344
    {
345
        case template_view::summary:
2 ✔
346
            send_template_summary(*held);
2 ✔
347
            return;
2 ✔
348
        case template_view::txs:
4 ✔
349
            send_template_txs(*held, media);
4 ✔
350
            return;
4 ✔
351
        case template_view::details:
5 ✔
352
            send_template_txs_details(*held, media);
5 ✔
353
            return;
5 ✔
354
    }
355
}
356

357
void protocol_native::send_template_summary(
2 ✔
358
    const node::block_template& held) NOEXCEPT
359
{
360
    BC_ASSERT(stranded());
2 ✔
361
    const auto& query = archive();
2 ✔
362
    size_t nominal{}, maximal{};
363
    for (const auto& link: held.links)
4 ✔
364
    {
365
        size_t light{}, heavy{};
2 ✔
366
        if (!query.get_tx_sizes(light, heavy, link))
2 ✔
367
        {
368
            send_internal_server_error(database::error::integrity);
×
369
            return;
×
370
        }
371

372
        nominal = ceilinged_add(nominal, light);
2 ✔
373
        maximal = ceilinged_add(maximal, heavy);
2 ✔
374
    }
375

376
    auto roots = to_roots(held.txs);
2 ✔
377
    std::vector<bool> labeled(roots.size(), false);
2 ✔
378
    size_t clusters{};
2 ✔
379
    for (size_t index{}; index < roots.size(); ++index)
4 ✔
380
    {
381
        const auto root = to_root(roots, index);
2 ✔
382
        if (!labeled.at(root))
2 ✔
383
        {
384
            labeled.at(root) = true;
1 ✔
385
            ++clusters;
1 ✔
386
        }
387
    }
388

389
    send_json(system::json::object
2 ✔
390
    {
391
        { "height", held.context.height },
2 ✔
392
        { "count", held.links.size() },
2 ✔
393
        { "virtual", chain::virtual_size(nominal, maximal) },
2 ✔
394
        { "weight", chain::weighted_size(nominal, maximal) },
2 ✔
395
        { "fees", held.fees },
2 ✔
396
        { "clusters", clusters }
397
    });
398
}
2 ✔
399

400
void protocol_native::send_template_txs(const node::block_template& held,
4 ✔
401
    uint8_t media) NOEXCEPT
402
{
403
    BC_ASSERT(stranded());
4 ✔
404

405
    // Position zero is the coinbase, which is not of the template.
406
    hashes txids{ null_hash };
4 ✔
407
    txids.reserve(add1(held.txs.size()));
4 ✔
408
    for (const auto& tx: held.txs)
8 ✔
409
        txids.push_back(tx.txid);
4 ✔
410

411
    const auto size = txids.size() * hash_size;
4 ✔
412
    const auto bytes = pointer_cast<const uint8_t>(txids.data());
4 ✔
413
    switch (media)
4 ✔
414
    {
415
        case data:
1 ✔
416
            send_chunk(to_chunk({ bytes, std::next(bytes, size) }));
1 ✔
417
            return;
1 ✔
418
        case text:
1 ✔
419
            send_text(encode_base16({ bytes, std::next(bytes, size) }));
1 ✔
420
            return;
1 ✔
421
        case json:
2 ✔
422
        {
423
            system::json::array out(txids.size());
2 ✔
424
            std::ranges::transform(txids, out.begin(),
2 ✔
425
                [](const auto& hash) { return encode_hash(hash); });
4 ✔
426
            send_json(std::move(out));
2 ✔
427
            return;
428
        }
2 ✔
429
    }
430

431
    send_not_acceptable();
×
432
}
4 ✔
433

434
void protocol_native::send_template_txs_details(
5 ✔
435
    const node::block_template& held, uint8_t media) NOEXCEPT
436
{
437
    BC_ASSERT(stranded());
5 ✔
438
    tx_details txs{};
5 ✔
439
    if (!to_tx_details(txs, held.links, to_roots(held.txs)))
5 ✔
440
    {
441
        send_internal_server_error(database::error::integrity);
×
442
        return;
443
    }
444

445
    const auto weight = size_t{ node_settings().pool.coinbase_weight };
5 ✔
446
    const auto base = floored_subtract(weight, coinbase_witness_size) /
5 ✔
447
        chain::light_weight_factor;
5 ✔
448
    const auto maximal = base + coinbase_witness_size;
5 ✔
449
    const auto nominal = floored_subtract(maximal,
5 ✔
450
        coinbase_witness_size + coinbase_commitment_size);
451
    const auto bip42 = held.context.is_enabled(chain::flags::bip42_rule);
5 ✔
452
    const auto reward = ceilinged_add(to_subsidy(held.context.height, bip42),
10 ✔
453
        held.fees);
5 ✔
454

455
    tx_details out{};
5 ✔
456
    out.reserve(add1(txs.size()));
5 ✔
457
    out.push_back(tx_detail
10 ✔
458
    {
459
        possible_narrow_cast<uint32_t>(nominal),
5 ✔
460
        possible_narrow_cast<uint32_t>(maximal),
5 ✔
461
        reward,
462
        reward,
463
        0u,
464
        0u,
465
        0u
466
    });
467

468
    for (auto& tx: txs)
8 ✔
469
    {
470
        ++tx.cluster;
3 ✔
471
        out.push_back(tx);
3 ✔
472
    }
473

474
    send_tx_details(out, media);
5 ✔
475
}
5 ✔
476

477
void protocol_native::handle_get_txs(const code& ec, interface::txs,
375 ✔
478
    uint8_t, uint8_t) NOEXCEPT
479
{
480
    if (stopped(ec))
375 ✔
481
        return;
482

483
    send_not_implemented();
1 ✔
484
}
485

486
void protocol_native::handle_get_txs_details(const code& ec,
375 ✔
487
    interface::txs_details, uint8_t, uint8_t) NOEXCEPT
488
{
489
    if (stopped(ec))
375 ✔
490
        return;
491

492
    send_not_implemented();
1 ✔
493
}
494

495
void protocol_native::handle_get_txs_confirmed(const code& ec,
375 ✔
496
    interface::txs_confirmed, uint8_t, uint8_t) NOEXCEPT
497
{
498
    if (stopped(ec))
375 ✔
499
        return;
500

501
    send_not_implemented();
1 ✔
502
}
503

504
void protocol_native::handle_get_txs_confirmed_details(const code& ec,
375 ✔
505
    interface::txs_confirmed_details, uint8_t, uint8_t) NOEXCEPT
506
{
507
    if (stopped(ec))
375 ✔
508
        return;
509

510
    send_not_implemented();
1 ✔
511
}
512

513
void protocol_native::handle_get_txs_unconfirmed(const code& ec,
378 ✔
514
    interface::txs_unconfirmed, uint8_t, uint8_t media) NOEXCEPT
515
{
516
    if (stopped(ec))
378 ✔
517
        return;
518

519
    get_txs_unconfirmed(false, media);
4 ✔
520
}
521

522
void protocol_native::handle_get_txs_unconfirmed_details(const code& ec,
378 ✔
523
    interface::txs_unconfirmed_details, uint8_t, uint8_t media) NOEXCEPT
524
{
525
    if (stopped(ec))
378 ✔
526
        return;
527

528
    get_txs_unconfirmed(true, media);
4 ✔
529
}
530

531
void protocol_native::get_txs_unconfirmed(bool details,
8 ✔
532
    uint8_t media) NOEXCEPT
533
{
534
    get_confirmable_txs(BIND(handle_txs_unconfirmed, _1, _2, details, media,
8 ✔
535
        gate()));
536
}
8 ✔
537

538
void protocol_native::handle_txs_unconfirmed(const code& ec,
8 ✔
539
    const database::tx_links& links, bool details, uint8_t media,
540
    const gate_t::ptr& gate) NOEXCEPT
541
{
542
    POST(complete_get_txs_unconfirmed, ec, links, details, media, gate);
8 ✔
543
}
8 ✔
544

545
void protocol_native::complete_get_txs_unconfirmed(const code& ec,
8 ✔
546
    const database::tx_links& links, bool details, uint8_t media,
547
    const gate_t::ptr&) NOEXCEPT
548
{
549
    BC_ASSERT(stranded());
8 ✔
550

551
    if (stopped())
8 ✔
552
        return;
8 ✔
553

554
    if (ec == node::error::pooling_disabled)
8 ✔
555
    {
556
        if (network_settings().enable_relay)
2 ✔
NEW
557
            send_service_unavailable();
×
558
        else
559
            send_not_implemented();
2 ✔
560

561
        return;
2 ✔
562
    }
563

564
    if (ec)
6 ✔
565
    {
NEW
566
        send_internal_server_error(ec);
×
NEW
567
        return;
×
568
    }
569

570
    if (details)
6 ✔
571
    {
572
        tx_details out{};
3 ✔
573
        if (!to_tx_details(out, links, to_roots(links)))
3 ✔
574
        {
NEW
575
            send_internal_server_error(database::error::integrity);
×
NEW
576
            return;
×
577
        }
578

579
        const auto& query = archive();
3 ✔
580
        for (size_t index{}; index < links.size(); ++index)
6 ✔
581
            query.get_pooled_time(out.at(index).time, links.at(index));
3 ✔
582

583
        send_tx_details(out, media, true);
3 ✔
584
        return;
585
    }
3 ✔
586

587
    const auto& query = archive();
3 ✔
588
    hashes txids(links.size());
3 ✔
589
    std::ranges::transform(links, txids.begin(),
3 ✔
590
        [&](const auto& link) NOEXCEPT { return query.get_tx_key(link); });
3 ✔
591

592
    const auto size = txids.size() * hash_size;
3 ✔
593
    const auto bytes = pointer_cast<const uint8_t>(txids.data());
3 ✔
594
    switch (media)
3 ✔
595
    {
596
        case data:
1 ✔
597
            send_chunk(to_chunk({ bytes, std::next(bytes, size) }));
1 ✔
598
            return;
1 ✔
NEW
599
        case text:
×
NEW
600
            send_text(encode_base16({ bytes, std::next(bytes, size) }));
×
NEW
601
            return;
×
602
        case json:
2 ✔
603
        {
604
            system::json::array out(txids.size());
2 ✔
605
            std::ranges::transform(txids, out.begin(),
2 ✔
606
                [](const auto& hash) { return encode_hash(hash); });
2 ✔
607
            send_json(std::move(out));
2 ✔
608
            return;
609
        }
2 ✔
610
    }
611

NEW
612
    send_not_acceptable();
×
613
}
3 ✔
614

615
void protocol_native::handle_get_fees(const code& ec, interface::fees,
381 ✔
616
    uint8_t, uint8_t media) NOEXCEPT
617
{
618
    if (stopped(ec))
381 ✔
619
        return;
620

621
    if (media != json)
7 ✔
622
    {
623
        send_not_acceptable();
2 ✔
624
        return;
2 ✔
625
    }
626

627
    get_confirmable_fees(BIND(handle_fees, _1, _2, gate()));
5 ✔
628
}
629

630
void protocol_native::handle_fees(const code& ec,
5 ✔
631
    const database::fee_rates& rates, const gate_t::ptr& gate) NOEXCEPT
632
{
633
    POST(complete_get_fees, ec, rates, gate);
5 ✔
634
}
5 ✔
635

636
void protocol_native::complete_get_fees(const code& ec,
5 ✔
637
    const database::fee_rates& rates, const gate_t::ptr&) NOEXCEPT
638
{
639
    BC_ASSERT(stranded());
5 ✔
640

641
    if (stopped())
5 ✔
642
        return;
3 ✔
643

644
    // Closed pool is not implemented with relay disabled, and is otherwise
645
    // unavailable until it opens.
646
    if (ec == node::error::pooling_disabled)
5 ✔
647
    {
648
        if (network_settings().enable_relay)
3 ✔
649
            send_service_unavailable();
2 ✔
650
        else
651
            send_not_implemented();
1 ✔
652

653
        return;
3 ✔
654
    }
655

656
    if (ec)
2 ✔
657
    {
658
        send_internal_server_error(ec);
×
659
        return;
×
660
    }
661

662
    const auto summary = to_fee_summary(rates, histogram_bin);
2 ✔
663
    system::json::object object
664
    {
665
        { "count", summary.count },
666
        { "virtual", summary.vsize },
667
        { "fee", summary.fee },
668
        { "histogram", system::json::value_from(summary.histogram) }
4 ✔
669
    };
4 ✔
670

671
    send_json(std::move(object));
2 ✔
672
}
2 ✔
673

674
BC_POP_WARNING()
675
BC_POP_WARNING()
676

677
} // namespace server
678
} // 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