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

libbitcoin / libbitcoin-server / 44691724904

20 Nov 2026 06:59AM UTC coverage: 95.15% (+0.05%) from 95.102%
44691724904

push

github

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

Fix test, disable admin channel inactivity and expiration by default.

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

122 existing lines in 14 files now uncovered.

12792 of 13444 relevant lines covered (95.15%)

445.71 hits per line

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

96.45
/src/protocols/native/protocol_native_block.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 <optional>
23
#include <ranges>
24
#include <bitcoin/server/define.hpp>
25

26
namespace libbitcoin {
27
namespace server {
28

29
using namespace system;
30
using namespace network::messages::peer;
31

32
BC_PUSH_WARNING(NO_INCOMPLETE_SWITCH)
33
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
34

35
bool protocol_native::handle_get_top(const code& ec, interface::top,
308 ✔
36
    uint8_t, uint8_t media) NOEXCEPT
37
{
38
    if (stopped(ec))
308 ✔
39
        return false;
40

41
    switch (media)
31 ✔
42
    {
43
        case data:
7 ✔
44
            send_chunk(to_tops());
7 ✔
45
            return true;
7 ✔
46
        case text:
5 ✔
47
            send_text(encode_base16(to_tops()));
5 ✔
48
            return true;
5 ✔
49
        case json:
19 ✔
50
            send_json(to_tops_json());
19 ✔
51
            return true;
19 ✔
52
    }
53

54
    send_not_found();
×
55
    return true;
×
56
}
57

58
bool protocol_native::handle_get_top_subscribe(const code& ec,
288 ✔
59
    interface::top_subscribe, uint8_t version, uint8_t media,
60
    bool stop) NOEXCEPT
61
{
62
    if (stopped(ec))
288 ✔
63
        return false;
64

65
    const auto value = stop ? media_type::unknown : (media_type)media;
11 ✔
66
    top_subscribe_.store(value, std::memory_order_relaxed);
11 ✔
67
    if (stop)
11 ✔
68
    {
69
        send_empty();
1 ✔
70
        return true;
1 ✔
71
    }
72

73
    return handle_get_top(ec, {}, version, media);
10 ✔
74
}
75

76
bool protocol_native::handle_get_top_chain(const code& ec,
282 ✔
77
    interface::top_chain, uint8_t, uint8_t media, bool candidate) NOEXCEPT
78
{
79
    if (stopped(ec))
282 ✔
80
        return false;
81

82
    switch (media)
5 ✔
83
    {
84
        case data:
1 ✔
85
            send_chunk(to_top(candidate));
1 ✔
86
            return true;
1 ✔
87
        case text:
1 ✔
88
            send_text(encode_base16(to_top(candidate)));
1 ✔
89
            return true;
1 ✔
90
        case json:
3 ✔
91
            send_json(to_top_json(candidate));
3 ✔
92
            return true;
3 ✔
93
    }
94

UNCOV
95
    send_not_found();
×
UNCOV
96
    return true;
×
97
}
98

99
bool protocol_native::handle_get_top_height(const code& ec,
282 ✔
100
    interface::top_height, uint8_t, uint8_t media, bool candidate) NOEXCEPT
101
{
102
    if (stopped(ec))
282 ✔
103
        return false;
104

105
    const auto& query = archive();
5 ✔
106
    const auto height = possible_narrow_cast<uint32_t>(candidate ?
5 ✔
107
        query.get_top_candidate() : query.get_top_confirmed());
5 ✔
108

109
    switch (media)
5 ✔
110
    {
111
        case data:
1 ✔
112
            send_chunk(to_chunk(to_little_endian(height)));
1 ✔
113
            return true;
1 ✔
114
        case text:
1 ✔
115
            send_text(encode_base16(to_little_endian(height)));
1 ✔
116
            return true;
1 ✔
117
        case json:
3 ✔
118
            send_json(height);
3 ✔
119
            return true;
3 ✔
120
    }
121

UNCOV
122
    send_not_found();
×
UNCOV
123
    return true;
×
124
}
125

126
// notify
127
void protocol_native::do_top(media_type media) NOEXCEPT
6 ✔
128
{
129
    BC_ASSERT(stranded());
6 ✔
130

131
    switch (to_value(media))
6 ✔
132
    {
133
        case data:
4 ✔
134
            notify_chunk(to_tops());
4 ✔
135
            return;
4 ✔
136
        case text:
1 ✔
137
            notify_text(encode_base16(to_tops()));
1 ✔
138
            return;
1 ✔
139
        case json:
1 ✔
140
            notify_json(to_tops_json());
1 ✔
141
            return;
1 ✔
142
    }
143
}
144

145
bool protocol_native::handle_get_block(const code& ec, interface::block,
292 ✔
146
    uint8_t, uint8_t media, std::optional<hash_cptr> hash,
147
    std::optional<uint32_t> height, bool witness, bool candidate) NOEXCEPT
148
{
149
    if (stopped(ec))
292 ✔
150
        return false;
151

152
    const auto& query = archive();
15 ✔
153
    const auto link = to_header(height, hash, candidate);
15 ✔
154
    if (link.is_terminal())
15 ✔
155
    {
156
        send_not_found();
5 ✔
157
        return true;
158
    }
159

160
    size_t size{};
10 ✔
161
    if (!query.get_block_size(size, link, witness))
10 ✔
162
    {
163
        send_internal_server_error(database::error::integrity);
1 ✔
164
        return true;
1 ✔
165
    }
166

167
    switch (media)
9 ✔
168
    {
169
        case data:
5 ✔
170
        {
171
            send_stream(size, [&query, link, witness, turbo = turbo_](
5 ✔
172
                const data_slab& out) NOEXCEPT
173
            {
174
                return query.get_wire_block(out, link, witness, turbo);
5 ✔
175
            }, media_type::application_octet_stream);
176
            return true;
5 ✔
177
        }
178
        case text:
1 ✔
179
        {
180
            send_stream(two * size, [&query, link, witness, turbo = turbo_](
1 ✔
181
                const data_slab& out) NOEXCEPT
182
            {
183
                return query.get_wire_block<write::base16::fast>(out, link,
1 ✔
184
                    witness, turbo);
1 ✔
185
            }, media_type::text_plain);
186
            return true;
1 ✔
187
        }
188
        case json:
3 ✔
189
        {
190
            const auto block = query.get_block(link, witness);
3 ✔
191
            if (!block)
3 ✔
192
            {
UNCOV
193
                send_internal_server_error(database::error::integrity);
×
UNCOV
194
                return true;
×
195
            }
196

197
            auto model = value_from(block);
3 ✔
198
            inject(model.at("header"), height, link);
3 ✔
199
            send_json(std::move(model));
3 ✔
200
            return true;
201
        }
3 ✔
202
    }
203

UNCOV
204
    send_not_found();
×
205
    return true;
206
}
15 ✔
207

208
bool protocol_native::handle_get_block_header(const code& ec,
285 ✔
209
    interface::block_header, uint8_t, uint8_t media,
210
    std::optional<hash_cptr> hash, std::optional<uint32_t> height,
211
    bool candidate) NOEXCEPT
212
{
213
    if (stopped(ec))
285 ✔
214
        return false;
215

216
    const auto link = to_header(height, hash, candidate);
8 ✔
217
    if (const auto header = archive().get_header(link))
8 ✔
218
    {
219
        constexpr auto size = chain::header::serialized_size();
220
        switch (media)
5 ✔
221
        {
222
            case data:
1 ✔
223
                send_chunk(to_bin(*header, size));
1 ✔
224
                return true;
1 ✔
225
            case text:
1 ✔
226
                send_text(to_hex(*header, size));
1 ✔
227
                return true;
1 ✔
228
            case json:
3 ✔
229
                auto model = value_from(header);
3 ✔
230
                inject(model, height, link);
3 ✔
231
                send_json(std::move(model));
3 ✔
232
                return true;
233
        }
3 ✔
234
    }
8 ✔
235

236
    send_not_found();
3 ✔
237
    return true;
238
}
8 ✔
239

240
bool protocol_native::handle_get_block_header_context(const code& ec,
282 ✔
241
    interface::block_header_context, uint8_t, uint8_t media,
242
    std::optional<hash_cptr> hash, std::optional<uint32_t> height,
243
    bool candidate) NOEXCEPT
244
{
245
    if (stopped(ec))
282 ✔
246
        return false;
247

248
    if (media != json)
5 ✔
249
    {
250
        send_not_acceptable();
1 ✔
251
        return true;
1 ✔
252
    }
253

254
    database::context context{};
4 ✔
255
    const auto& query = archive();
4 ✔
256
    const auto link = to_header(height, hash, candidate);
4 ✔
257
    if (!query.get_context(context, link))
4 ✔
258
    {
259
        send_not_found();
2 ✔
260
        return true;
261
    }
262

263
    system::json::object object
264
    {
265
        { "hash", encode_hash(query.get_header_key(link)) },
4 ✔
266
        { "height", context.height },
267
        { "mtp", context.mtp },
268
    };
2 ✔
269

270
    // The "state" element implies transactions are associated.
271
    if (query.is_associated(link))
2 ✔
272
    {
273
        size_t nominal{}, maximal{};
2 ✔
274
        if (!query.get_block_sizes(nominal, maximal, link))
2 ✔
275
        {
UNCOV
276
            send_internal_server_error(database::error::integrity);
×
UNCOV
277
            return true;
×
278
        }
279

280
        const auto bypass = query.is_bypass(link);
2 ✔
281

282
        object["state"] = system::json::object
6 ✔
283
        {
284
            { "size", nominal },
285
            { "weight", chain::weighted_size(nominal, maximal) },
2 ✔
286
            { "count", query.get_tx_count(link) },
2 ✔
287
            { "validated", bypass || query.is_validated(link) },
2 ✔
288
            { "confirmed", query.is_confirmed_block(link) },
2 ✔
289
            { "confirmable", bypass || query.is_confirmable(link) },
2 ✔
290
            { "unconfirmable", !bypass && query.is_unconfirmable(link) }
4 ✔
291
        };
2 ✔
292
    }
293

294
    // TODO: move to system serializer.
295
    // All modern configurable forks.
296
    object["forks"] = system::json::object
4 ✔
297
    {
298
        { "bip16",  context.is_enabled(chain::flags::bip16_rule) },
2 ✔
299
        { "bip30",  context.is_enabled(chain::flags::bip30_rule) },
2 ✔
300
        { "bip34",  context.is_enabled(chain::flags::bip34_rule) },
2 ✔
301
        { "bip66",  context.is_enabled(chain::flags::bip66_rule) },
2 ✔
302
        { "bip65",  context.is_enabled(chain::flags::bip65_rule) },
2 ✔
303
        { "bip90",  context.is_enabled(chain::flags::bip90_rule) },
2 ✔
304
        { "bip68",  context.is_enabled(chain::flags::bip68_rule) },
2 ✔
305
        { "bip112", context.is_enabled(chain::flags::bip112_rule) },
2 ✔
306
        { "bip113", context.is_enabled(chain::flags::bip113_rule) },
2 ✔
307
        { "bip141", context.is_enabled(chain::flags::bip141_rule) },
2 ✔
308
        { "bip143", context.is_enabled(chain::flags::bip143_rule) },
2 ✔
309
        { "bip147", context.is_enabled(chain::flags::bip147_rule) },
2 ✔
310
        { "bip42",  context.is_enabled(chain::flags::bip42_rule) },
2 ✔
311
        { "bip341", context.is_enabled(chain::flags::bip341_rule) },
2 ✔
312
        { "bip342", context.is_enabled(chain::flags::bip342_rule) },
2 ✔
313
        { "bip54_timewarp", context.is_enabled(chain::flags::bip54_timewarp_rule) },
2 ✔
314
        { "bip54_timespan", context.is_enabled(chain::flags::bip54_timespan_rule) },
2 ✔
315
        { "bip54_sigops", context.is_enabled(chain::flags::bip54_sigops_rule) },
2 ✔
316
        { "bip54_txsize", context.is_enabled(chain::flags::bip54_txsize_rule) },
2 ✔
317
        { "bip54_coinbase", context.is_enabled(chain::flags::bip54_coinbase_rule) }
2 ✔
318
    };
2 ✔
319

320
    send_json(std::move(object));
2 ✔
321
    return true;
2 ✔
322
}
4 ✔
323

324
bool protocol_native::handle_get_block_details(const code& ec,
284 ✔
325
    interface::block_details, uint8_t, uint8_t media,
326
    std::optional<hash_cptr> hash, std::optional<uint32_t> height,
327
    bool candidate) NOEXCEPT
328
{
329
    if (stopped(ec))
284 ✔
330
        return false;
331

332
    if (media != json)
7 ✔
333
    {
334
        send_not_acceptable();
1 ✔
335
        return true;
1 ✔
336
    }
337

338
    const auto& query = archive();
6 ✔
339
    const auto link = to_header(height, hash, candidate);
6 ✔
340

341
    // Missing block.
342
    if (!query.is_associated(link))
6 ✔
343
    {
344
        send_not_found();
2 ✔
345
        return true;
346
    }
347

348
    const auto count = query.get_tx_count(link);
4 ✔
349
    const auto key = hash.has_value() ? *hash.value() :
4 ✔
350
        query.get_header_key(link);
4 ✔
351

352
    database::context context{};
4 ✔
353
    size_t nominal{}, maximal{};
4 ✔
354
    uint64_t value{}, spend{}, claim{};
4 ✔
355
    if (is_zero(count) || key == system::null_hash ||
8 ✔
356
        !query.get_tx_spend(claim, query.to_coinbase(link)) ||
12 ✔
357
        !query.get_block_sizes(nominal, maximal, link) ||
8 ✔
358
        !query.get_block_value(value, link) ||
7 ✔
359
        !query.get_block_spend(spend, link) ||
6 ✔
360
        !query.get_context(context, link) ||
7 ✔
361
        is_subtract_overflow(value, spend))
3 ✔
362
    {
363
        send_internal_server_error(database::error::integrity);
1 ✔
364
        return true;
1 ✔
365
    }
366

367
    const auto fees = floored_subtract(value, spend);
3 ✔
368
    const auto& settings = system_settings();
3 ✔
369
    const auto bip42 = context.is_enabled(chain::flags::bip42_rule);
3 ✔
370
    const auto subsidy = chain::block::subsidy(context.height,
6 ✔
371
        settings.subsidy_interval_blocks, settings.initial_subsidy(), bip42);
3 ✔
372

373
    // sigops is not cached, so removed for now.
374
    system::json::object object
375
    {
376
        { "hash", encode_hash(key) },
6 ✔
377
        { "height", context.height },
378
        { "count", count },
379
        { "segregated", maximal != nominal },
6 ✔
380
        { "nominal", nominal },
381
        { "maximal", maximal },
382
        { "weight", chain::weighted_size(nominal, maximal) },
6 ✔
383
        { "virtual", chain::virtual_size(nominal, maximal) },
6 ✔
384
        { "value", value },
385
        { "fees", fees },
386
        { "subsidy", subsidy },
387
        { "reward", ceilinged_add(fees, subsidy) },
3 ✔
388
        { "claim", claim }
389
    };
6 ✔
390

391
    send_json(std::move(object));
3 ✔
392
    return true;
393
}
6 ✔
394

395
bool protocol_native::handle_get_block_txs(const code& ec,
283 ✔
396
    interface::block_txs, uint8_t, uint8_t media,
397
    std::optional<hash_cptr> hash, std::optional<uint32_t> height,
398
    bool candidate) NOEXCEPT
399
{
400
    if (stopped(ec))
283 ✔
401
        return false;
402

403
    const auto& query = archive();
6 ✔
404
    if (const auto hashes = query.get_tx_keys(to_header(height, hash, candidate));
12 ✔
405
        !hashes.empty())
6 ✔
406
    {
407
        const auto size = hashes.size() * hash_size;
4 ✔
408
        switch (media)
4 ✔
409
        {
410
            case data:
2 ✔
411
            {
412
                const auto bytes = pointer_cast<const uint8_t>(hashes.data());
2 ✔
413
                send_chunk(to_chunk({ bytes, std::next(bytes, size) }));
2 ✔
414
                return true;
2 ✔
415
            }
416
            case text:
1 ✔
417
            {
418
                const auto bytes = pointer_cast<const uint8_t>(hashes.data());
1 ✔
419
                send_text(encode_base16({ bytes, std::next(bytes, size) }));
1 ✔
420
                return true;
1 ✔
421
            }
422
            case json:
1 ✔
423
            {
424
                system::json::array out(hashes.size());
1 ✔
425
                std::ranges::transform(hashes, out.begin(),
1 ✔
426
                    [](const auto& hash) { return encode_hash(hash); });
1 ✔
427
                send_json(out);
1 ✔
428
                return true;
429
            }
1 ✔
430
        }
431
    }
6 ✔
432

433
    send_not_found();
2 ✔
434
    return true;
2 ✔
435
}
436

437
bool protocol_native::handle_get_block_filter(const code& ec,
289 ✔
438
    interface::block_filter, uint8_t, uint8_t media, uint8_t type,
439
    std::optional<hash_cptr> hash, std::optional<uint32_t> height,
440
    bool candidate) NOEXCEPT
441
{
442
    if (stopped(ec))
289 ✔
443
        return false;
444

445
    const auto& query = archive();
12 ✔
446
    if (!query.filter_enabled() || type != client_filter::type_id::neutrino)
12 ✔
447
    {
448
        send_not_implemented();
1 ✔
449
        return true;
1 ✔
450
    }
451

452
    data_chunk filter{};
11 ✔
453
    if (query.get_filter_body(filter, to_header(height, hash, candidate)))
11 ✔
454
    {
455
        switch (media)
9 ✔
456
        {
457
            case data:
7 ✔
458
                send_chunk(std::move(filter));
7 ✔
459
                return true;
460
            case text:
1 ✔
461
                send_text(encode_base16(filter));
1 ✔
462
                return true;
1 ✔
463
            case json:
1 ✔
464
                send_json(value_from(encode_base16(filter)));
1 ✔
465
                return true;
1 ✔
466
        }
467
    }
468

469
    send_not_found();
2 ✔
470
    return true;
471
}
11 ✔
472

473
bool protocol_native::handle_get_block_filter_hash(const code& ec,
284 ✔
474
    interface::block_filter_hash, uint8_t, uint8_t media, uint8_t type,
475
    std::optional<hash_cptr> hash, std::optional<uint32_t> height,
476
    bool candidate) NOEXCEPT
477
{
478
    if (stopped(ec))
284 ✔
479
        return false;
480

481
    const auto& query = archive();
7 ✔
482
    if (!query.filter_enabled() || type != client_filter::type_id::neutrino)
7 ✔
483
    {
484
        send_not_implemented();
1 ✔
485
        return true;
1 ✔
486
    }
487

488
    hash_digest filter_hash{ hash_size };
6 ✔
489
    if (query.get_filter_hash(filter_hash, to_header(height, hash, candidate)))
6 ✔
490
    {
491
        switch (media)
4 ✔
492
        {
493
            case data:
2 ✔
494
                send_chunk(to_chunk(filter_hash));
2 ✔
495
                return true;
2 ✔
496
            case text:
1 ✔
497
                send_text(encode_base16(filter_hash));
1 ✔
498
                return true;
1 ✔
499
            case json:
1 ✔
500
                send_json(value_from(encode_hash(filter_hash)));
1 ✔
501
                return true;
1 ✔
502
        }
503
    }
504

505
    send_not_found();
2 ✔
506
    return true;
507
}
508

509
bool protocol_native::handle_get_block_filter_header(const code& ec,
283 ✔
510
    interface::block_filter_header, uint8_t, uint8_t media, uint8_t type,
511
    std::optional<hash_cptr> hash, std::optional<uint32_t> height,
512
    bool candidate) NOEXCEPT
513
{
514
    if (stopped(ec))
283 ✔
515
        return false;
516

517
    const auto& query = archive();
6 ✔
518
    if (!query.filter_enabled() || type != client_filter::type_id::neutrino)
6 ✔
519
    {
520
        send_not_implemented();
1 ✔
521
        return true;
1 ✔
522
    }
523

524
    hash_digest filter_head{ hash_size };
5 ✔
525
    if (query.get_filter_head(filter_head, to_header(height, hash, candidate)))
5 ✔
526
    {
527
        switch (media)
3 ✔
528
        {
529
            case data:
1 ✔
530
                send_chunk(to_chunk(filter_head));
1 ✔
531
                return true;
1 ✔
532
            case text:
1 ✔
533
                send_text(encode_base16(filter_head));
1 ✔
534
                return true;
1 ✔
535
            case json:
1 ✔
536
                send_json(value_from(encode_hash(filter_head)));
1 ✔
537
                return true;
1 ✔
538
        }
539
    }
540

541
    send_not_found();
2 ✔
542
    return true;
543
}
544

545
bool protocol_native::handle_get_block_tx(const code& ec, interface::block_tx,
283 ✔
546
    uint8_t, uint8_t media, uint32_t position, std::optional<hash_cptr> hash,
547
    std::optional<uint32_t> height, bool witness, bool candidate) NOEXCEPT
548
{
549
    if (stopped(ec))
283 ✔
550
        return false;
551

552
    const auto& query = archive();
6 ✔
553
    if (const auto tx = query.get_transaction(query.to_transaction(
12 ✔
554
        to_header(height, hash, candidate), position), witness))
18 ✔
555
    {
556
        const auto size = tx->serialized_size(witness);
4 ✔
557
        switch (media)
4 ✔
558
        {
559
            case data:
2 ✔
560
                send_chunk(to_bin(*tx, size, witness));
2 ✔
561
                return true;
2 ✔
562
            case text:
1 ✔
563
                send_text(to_hex(*tx, size, witness));
1 ✔
564
                return true;
1 ✔
565
            case json:
1 ✔
566
                send_json(value_from(tx));
1 ✔
567
                return true;
1 ✔
568
        }
569
    }
6 ✔
570

571
    send_not_found();
2 ✔
572
    return true;
2 ✔
573
}
574

575
bool protocol_native::handle_get_block_subscribe(const code& ec,
284 ✔
576
    interface::block_subscribe, uint8_t, uint8_t media, bool stop) NOEXCEPT
577
{
578
    if (stopped(ec))
284 ✔
579
        return false;
580

581
    const auto value = stop ? media_type::unknown : (media_type)media;
7 ✔
582
    block_subscribe_.store(value, std::memory_order_relaxed);
7 ✔
583
    if (stop)
7 ✔
584
    {
585
        send_empty();
1 ✔
586
        return true;
1 ✔
587
    }
588

589
    // Return top block hash upon block subscription.
590
    const auto& query = archive();
6 ✔
591
    const auto link = query.to_top_confirmed();
6 ✔
592
    if (const auto hash = query.get_header_key(link); hash != null_hash)
6 ✔
593
    {
594
        switch (media)
6 ✔
595
        {
596
            case data:
2 ✔
597
                send_chunk(to_chunk(hash));
2 ✔
598
                return true;
6 ✔
599
            case text:
2 ✔
600
                send_text(encode_base16(hash));
2 ✔
601
                return true;
2 ✔
602
            case json:
2 ✔
603
                send_json(value_from(encode_hash(hash)));
2 ✔
604
                return true;
2 ✔
605
        }
606
    }
607

UNCOV
608
    send_not_found();
×
609
    return true;
610
}
6 ✔
611

612
// notify
613
void protocol_native::do_block(node::header_t link, media_type media) NOEXCEPT
3 ✔
614
{
615
    BC_ASSERT(stranded());
3 ✔
616

617
    const auto hash = archive().get_header_key(link);
3 ✔
618
    switch (to_value(media))
3 ✔
619
    {
620
        case data:
1 ✔
621
            notify_chunk(to_chunk(hash));
1 ✔
622
            return;
3 ✔
623
        case text:
1 ✔
624
            notify_text(encode_base16(hash));
1 ✔
625
            return;
1 ✔
626
        case json:
1 ✔
627
            notify_json(value_from(encode_hash(hash)));
1 ✔
628
            return;
1 ✔
629
    }
630
}
631

632
BC_POP_WARNING()
633
BC_POP_WARNING()
634

635
} // namespace server
636
} // 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