Make sure both filter ehaders and filters are empty before sending fi… (#1936)

* Make sure both filter ehaders and filters are empty before sending first filterheader sync message

* Address nit
This commit is contained in:
Chris Stewart 2020-08-31 06:32:01 -05:00 committed by GitHub
parent 170242812c
commit e7993890cb
2 changed files with 4 additions and 2 deletions

View file

@ -125,7 +125,7 @@ sealed trait BlockHeader extends NetworkElement {
* [[https://bitcoin.stackexchange.com/questions/2063/why-does-the-bitcoin-protocol-use-the-little-endian-notation]]
* @return
*/
def hashBE: DoubleSha256DigestBE = hash.flip
lazy val hashBE: DoubleSha256DigestBE = hash.flip
override def bytes: ByteVector = RawBlockHeaderSerializer.write(this)

View file

@ -214,7 +214,9 @@ case class DataMessageHandler(
// so we also check if our cached filter heights have been set as well, if they haven't then
// we probably need to sync filters
if (
appConfig.nodeType == NodeType.NeutrinoNode && (!syncing || filterHeaderHeightOpt.isEmpty || filterHeightOpt.isEmpty)
appConfig.nodeType == NodeType.NeutrinoNode && (!syncing ||
(filterHeaderHeightOpt.isEmpty &&
filterHeightOpt.isEmpty))
)
sendFirstGetCompactFilterHeadersCommand(peerMsgSender)
else