Skip to content

Commit

Permalink
trivial: correct spelling of advertise
Browse files Browse the repository at this point in the history
  • Loading branch information
CaveSpectre11 committed Jul 14, 2019
1 parent 388a5c0 commit 22b340c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void MarkBlockAsInFlight(NodeId nodeid, const uint256& hash, CBlockIndex* pindex
mapBlocksInFlight[hash] = std::make_pair(nodeid, it);
}

/** Check whether the last unknown block a peer advertized is not yet known. */
/** Check whether the last unknown block a peer advertised is not yet known. */
void ProcessBlockAvailability(NodeId nodeid)
{
CNodeState* state = State(nodeid);
Expand Down Expand Up @@ -6252,11 +6252,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
if (fListen && !IsInitialBlockDownload()) {
CAddress addr = GetLocalAddress(&pfrom->addr);
if (addr.IsRoutable()) {
LogPrintf("ProcessMessages: advertizing address %s\n", addr.ToString());
LogPrintf("ProcessMessages: advertising address %s\n", addr.ToString());
pfrom->PushAddress(addr);
} else if (IsPeerAddrLocalGood(pfrom)) {
addr.SetIP(pfrom->addrLocal);
LogPrintf("ProcessMessages: advertizing address %s\n", addr.ToString());
LogPrintf("ProcessMessages: advertising address %s\n", addr.ToString());
pfrom->PushAddress(addr);
}
}
Expand Down Expand Up @@ -7242,7 +7242,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
pnode->setAddrKnown.clear();

// Rebroadcast our address
AdvertizeLocal(pnode);
AdvertiseLocal(pnode);
}
if (!vNodes.empty())
nLastRebroadcast = GetTime();
Expand Down Expand Up @@ -7367,7 +7367,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
// In case there is a block that has been in flight from this peer for (2 + 0.5 * N) times the block interval
// (with N the number of validated blocks that were in flight at the time it was requested), disconnect due to
// timeout. We compensate for in-flight blocks to prevent killing off peers due to our own downstream link
// being saturated. We only count validated in-flight blocks so peers can't advertize nonexisting block hashes
// being saturated. We only count validated in-flight blocks so peers can't advertise nonexisting block hashes
// to unreasonably increase our timeout.
if (!pto->fDisconnect && state.vBlocksInFlight.size() > 0 && state.vBlocksInFlight.front().nTime < nNow - 500000 * Params().TargetSpacing() * (4 + state.vBlocksInFlight.front().nValidatedQueuedBefore)) {
LogPrintf("Timeout downloading block %s from peer=%d, disconnecting\n", state.vBlocksInFlight.front().hash.ToString(), pto->id);
Expand Down
4 changes: 2 additions & 2 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ bool IsPeerAddrLocalGood(CNode* pnode)
}

// pushes our own address to a peer
void AdvertizeLocal(CNode* pnode)
void AdvertiseLocal(CNode* pnode)
{
if (fListen && pnode->fSuccessfullyConnected) {
CAddress addrLocal = GetLocalAddress(&pnode->addr);
Expand All @@ -234,7 +234,7 @@ void AdvertizeLocal(CNode* pnode)
addrLocal.SetIP(pnode->addrLocal);
}
if (addrLocal.IsRoutable()) {
LogPrintf("AdvertizeLocal: advertizing address %s\n", addrLocal.ToString());
LogPrintf("AdvertiseLocal: advertising address %s\n", addrLocal.ToString());
pnode->PushAddress(addrLocal);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ enum {
};

bool IsPeerAddrLocalGood(CNode* pnode);
void AdvertizeLocal(CNode* pnode);
void AdvertiseLocal(CNode* pnode);
void SetLimited(enum Network net, bool fLimited = true);
bool IsLimited(enum Network net);
bool IsLimited(const CNetAddr& addr);
Expand Down

0 comments on commit 22b340c

Please sign in to comment.