CConnman::AddConnection

Attempts to open a connection. Currently only used from tests.

Synopsis

Declared in <net.h>

[[requires_capability(0x7fbc935fa720, 0x7fbc935fa7e0), requires_capability(0x7fbc93361330, 0x7fbc933613f0), requires_capability(0x7fbc8742a7b0, 0x7fbc8742a870), requires_capability(0x7fbc97460390, 0x7fbc97460450), requires_capability(0x7fbc8e97c4d0, 0x7fbc8e97c590), requires_capability(0x7fbc859fd840, 0x7fbc859fd900), requires_capability(0x7fbc90e3aca0, 0x7fbc90e3ad60), requires_capability(0x7fbc8ec35dd0, 0x7fbc8ec35e90), requires_capability(0x7fbc92aee290, 0x7fbc92aee350), requires_capability(0x7fbc7cdafb00, 0x7fbc7cdafbc0), requires_capability(0x7fbc9fc8bca0, 0x7fbc9fc8bd60)]]
bool
AddConnection(
    std::string const& address,
    ConnectionType conn_type,
    bool use_v2transport);

Return Value

bool Returns false if there are no available slots for this connection: - conn_type not a supported ConnectionType - Max total outbound connection capacity filled - Max connection capacity for type is filled

Parameters

NameDescription
address [in]Address of node to try connecting to
conn_type [in]ConnectionType::OUTBOUND, ConnectionType::BLOCK_RELAY, ConnectionType::ADDR_FETCH or ConnectionType::FEELER
use_v2transport [in]Set to true if node attempts to connect using BIP 324 v2 transport protocol.