mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
Only log a warning instead of throwing an exception when we try to send a message to a peer we aren't connected to (#5161)
This commit is contained in:
parent
092ef944e2
commit
4afaaf8f22
@ -124,10 +124,7 @@ case class PeerManager(
|
|||||||
.map(_.peerMessageSender)
|
.map(_.peerMessageSender)
|
||||||
case _: DataPayload =>
|
case _: DataPayload =>
|
||||||
//peer must be fully initialized to send a data payload
|
//peer must be fully initialized to send a data payload
|
||||||
val msg =
|
None
|
||||||
s"Cannot find peerOpt=${sendToPeer.peerOpt} to send message=${sendToPeer.msg.payload.commandName} to. It may have been disconnected, sending to another random peer."
|
|
||||||
logger.warn(msg)
|
|
||||||
randomPeerMsgSenderWithService(ServiceIdentifier.NODE_NETWORK)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case None =>
|
case None =>
|
||||||
@ -139,8 +136,10 @@ case class PeerManager(
|
|||||||
peerMsgSender
|
peerMsgSender
|
||||||
.sendMsg(sendToPeer.msg)
|
.sendMsg(sendToPeer.msg)
|
||||||
case None =>
|
case None =>
|
||||||
sys.error(
|
val msg =
|
||||||
s"Unable to find peer message sender to send msg=${sendToPeer.msg.header.commandName} to. This means we are not connected to any peers.")
|
s"Cannot find peerOpt=${sendToPeer.peerOpt} in set of peers=$peers to send message=${sendToPeer.msg.payload.commandName} to. It may have been disconnected, or we have no peers."
|
||||||
|
logger.warn(msg)
|
||||||
|
Future.unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user