LCOV - code coverage report
Current view: top level - src/node - peerman_args.cpp (source / functions) Coverage Total Hit
Test: total_coverage.info Lines: 77.8 % 9 7
Test Date: 2025-06-01 06:26:32 Functions: 100.0 % 1 1
Branches: 54.2 % 24 13

             Branch data     Line data    Source code
       1                 :             : // Copyright (c) 2023-present The Bitcoin Core developers
       2                 :             : // Distributed under the MIT software license, see the accompanying
       3                 :             : // file COPYING or https://opensource.org/license/mit.
       4                 :             : 
       5                 :             : #include <node/peerman_args.h>
       6                 :             : 
       7                 :             : #include <common/args.h>
       8                 :             : #include <net_processing.h>
       9                 :             : 
      10                 :             : #include <algorithm>
      11                 :             : #include <limits>
      12                 :             : 
      13                 :             : namespace node {
      14                 :             : 
      15                 :        1165 : void ApplyArgsManOptions(const ArgsManager& argsman, PeerManager::Options& options)
      16                 :             : {
      17   [ +  -  +  + ]:        2330 :     if (auto value{argsman.GetBoolArg("-txreconciliation")}) options.reconcile_txs = *value;
      18                 :             : 
      19   [ +  -  -  + ]:        2330 :     if (auto value{argsman.GetIntArg("-maxorphantx")}) {
      20         [ #  # ]:           0 :         options.max_orphan_txs = uint32_t((std::clamp<int64_t>(*value, 0, std::numeric_limits<uint32_t>::max())));
      21                 :             :     }
      22                 :             : 
      23   [ +  -  -  + ]:        2330 :     if (auto value{argsman.GetIntArg("-blockreconstructionextratxn")}) {
      24         [ #  # ]:           0 :         options.max_extra_txs = uint32_t((std::clamp<int64_t>(*value, 0, std::numeric_limits<uint32_t>::max())));
      25                 :             :     }
      26                 :             : 
      27   [ +  -  +  + ]:        2330 :     if (auto value{argsman.GetBoolArg("-capturemessages")}) options.capture_messages = *value;
      28                 :             : 
      29   [ +  -  +  + ]:        2330 :     if (auto value{argsman.GetBoolArg("-blocksonly")}) options.ignore_incoming_txs = *value;
      30                 :        1165 : }
      31                 :             : 
      32                 :             : } // namespace node
      33                 :             : 
        

Generated by: LCOV version 2.0-1