mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Avoid calling CAddrMan::Connected() on block-relay-only peer addresses
Connected() updates the time we serve in addr messages, so avoid leaking block-relay-only peer connections by avoiding these calls.
This commit is contained in:
parent
d67883d01e
commit
daf5553126
5 changed files with 12 additions and 10 deletions
|
|
@ -837,7 +837,8 @@ void PeerManager::ReattemptInitialBroadcast(CScheduler& scheduler) const
|
|||
scheduler.scheduleFromNow([&] { ReattemptInitialBroadcast(scheduler); }, delta);
|
||||
}
|
||||
|
||||
void PeerManager::FinalizeNode(NodeId nodeid, bool& fUpdateConnectionTime) {
|
||||
void PeerManager::FinalizeNode(const CNode& node, bool& fUpdateConnectionTime) {
|
||||
NodeId nodeid = node.GetId();
|
||||
fUpdateConnectionTime = false;
|
||||
LOCK(cs_main);
|
||||
int misbehavior{0};
|
||||
|
|
@ -854,7 +855,8 @@ void PeerManager::FinalizeNode(NodeId nodeid, bool& fUpdateConnectionTime) {
|
|||
if (state->fSyncStarted)
|
||||
nSyncStarted--;
|
||||
|
||||
if (misbehavior == 0 && state->fCurrentlyConnected) {
|
||||
if (misbehavior == 0 && state->fCurrentlyConnected && !node.IsBlockOnlyConn()) {
|
||||
// Note: we avoid changing visible addrman state for block-relay-only peers
|
||||
fUpdateConnectionTime = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue