Stop requesting merkle block messages while in neutrino mode (#1730)

This commit is contained in:
Ben Carman 2020-08-05 13:00:04 -05:00 committed by GitHub
parent 61e49653b7
commit d67c547148

View file

@ -311,7 +311,10 @@ case class DataMessageHandler(
logger.info(s"Received inv=${invMsg}")
val getData = GetDataMessage(invMsg.inventories.map {
case Inventory(TypeIdentifier.MsgBlock, hash) =>
Inventory(TypeIdentifier.MsgFilteredBlock, hash)
// only request the merkle block if we are spv enabled
if (appConfig.isSPVEnabled) {
Inventory(TypeIdentifier.MsgFilteredBlock, hash)
} else Inventory(TypeIdentifier.MsgBlock, hash)
case other: Inventory => other
})
peerMsgSender.sendMsg(getData)