Adjust so that requery in the case were we have just 1 peer (#5240)

This commit is contained in:
Chris Stewart 2023-09-20 09:13:23 -05:00 committed by GitHub
parent 922a6aaeb4
commit 3763a53ad5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -500,8 +500,11 @@ case class DataMessageHandler(
queryF.map(_ => HeaderSync(newPeer, state.peers))
case None =>
logger.warn(
s"Received invalid header from peer=$peer. Only have 1 peer so cannot re-query, state=$state")
Future.successful(state)
s"Received invalid header from peer=$peer. Only have 1 peer so re-querying from same peer, state=$state")
val queryF = peerMessageSenderApi.sendGetHeadersMessage(
cachedHeaders,
Some(peer))
queryF.map(_ => state)
}
}