MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / AdvertizeLocal

Function AdvertizeLocal

src/net.cpp:147–158  ·  view source on GitHub ↗

used when scores of local addresses may have changed pushes better local address to peers

Source from the content-addressed store, hash-verified

145// used when scores of local addresses may have changed
146// pushes better local address to peers
147void static AdvertizeLocal() {
148 LOCK(cs_vNodes);
149 for (auto pNode : vNodes) {
150 if (pNode->fSuccessfullyConnected) {
151 CAddress addrLocal = GetLocalAddress(&pNode->addr);
152 if (addrLocal.IsRoutable() && (CService)addrLocal != (CService)pNode->addrLocal) {
153 pNode->PushAddress(addrLocal);
154 pNode->addrLocal = addrLocal;
155 }
156 }
157 }
158}
159
160void SetReachable(enum Network net, bool fFlag) {
161 LOCK(cs_mapLocalHost);

Callers 2

AddLocalFunction · 0.85
SeenLocalFunction · 0.85

Calls 3

GetLocalAddressFunction · 0.85
IsRoutableMethod · 0.80
PushAddressMethod · 0.80

Tested by

no test coverage detected