Skip to content

Commit

Permalink
net: Activate NODE_NETWORK_LIMITED and NODE_WITNESS service flags
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Sep 22, 2024
1 parent e8947c7 commit 661d4ec
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
4 changes: 0 additions & 4 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,7 @@ namespace { // Variables internal to initialization process only
int nMaxConnections;
int nUserMaxConnections;
int nFD;
/*
// Blackcoin: Do not set NODE_NETWORK_LIMITED and NODE_WITNESS flags
ServiceFlags nLocalServices = ServiceFlags(NODE_NETWORK_LIMITED | NODE_WITNESS);
*/
ServiceFlags nLocalServices = ServiceFlags(NODE_NETWORK);
int64_t peer_connect_timeout;
std::set<BlockFilterType> g_enabled_filter_types;

Expand Down
4 changes: 0 additions & 4 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2076,11 +2076,7 @@ std::optional<std::string> PeerManagerImpl::FetchBlock(NodeId peer_id, const CBl
// Construct message to request the block
const uint256& hash{block_index.GetBlockHash()};

/*
// Blackcoin: Do not send witness flag for now
std::vector<CInv> invs{CInv(MSG_BLOCK | MSG_WITNESS_FLAG, hash)};
*/
std::vector<CInv> invs{CInv(MSG_BLOCK, hash)};

// Send block request message to the peer
bool success = m_connman.ForNode(peer_id, [this, &invs](CNode* node) {
Expand Down
9 changes: 2 additions & 7 deletions src/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,11 @@ bool CMessageHeader::IsCommandValid() const


ServiceFlags GetDesirableServiceFlags(ServiceFlags services) {
/*
// Blackcoin: Do not ask for NODE_WITNESS for now
if ((services & NODE_NETWORK_LIMITED) && g_initial_block_download_completed) {
return ServiceFlags(NODE_NETWORK_LIMITED | NODE_WITNESS);
}
return ServiceFlags(NODE_NETWORK | NODE_WITNESS);
*/
if ((services & NODE_NETWORK_LIMITED) && g_initial_block_download_completed) {
return ServiceFlags(NODE_NETWORK_LIMITED);
}
// Blackcoin: Do not ask for NODE_WITNESS for now
// return ServiceFlags(NODE_NETWORK | NODE_WITNESS);
return ServiceFlags(NODE_NETWORK);
}

Expand Down

0 comments on commit 661d4ec

Please sign in to comment.