Change requesting filters log to use big endian hashes (#2048)

This commit is contained in:
Ben Carman 2020-09-23 12:02:34 -05:00 committed by GitHub
parent 1b57cac8ae
commit 795d62c041
2 changed files with 9 additions and 4 deletions

View File

@ -8,4 +8,10 @@ import org.bitcoins.crypto.DoubleSha256Digest
* of filters sent back to us by our peer
* @see https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki#cfheaders
*/
case class FilterSyncMarker(startHeight: Int, stopBlockHash: DoubleSha256Digest)
case class FilterSyncMarker(
startHeight: Int,
stopBlockHash: DoubleSha256Digest) {
override def toString: String =
s"FilterSyncMarker(startHeight = $stopBlockHash, stopBlockHash=${stopBlockHash.flip.hex})"
}

View File

@ -197,8 +197,7 @@ case class PeerMessageSender(client: P2PClient)(implicit conf: NodeAppConfig)
chainApi.nextFilterHeaderBatchRange(stopHash, filterBatchSize)
res <- filterSyncMarkerOpt match {
case Some(filterSyncMarker) =>
logger.info(
s"Requesting compact filters from=${filterSyncMarker.startHeight} to=${filterSyncMarker.stopBlockHash}")
logger.info(s"Requesting compact filters from $filterSyncMarker")
sendGetCompactFiltersMessage(filterSyncMarker)
.map(_ => true)
@ -220,7 +219,7 @@ case class PeerMessageSender(client: P2PClient)(implicit conf: NodeAppConfig)
res <- filterSyncMarkerOpt match {
case Some(filterSyncMarker) =>
logger.info(
s"Requesting next compact filter headers from=${filterSyncMarker.startHeight} to=${filterSyncMarker.stopBlockHash.flip}")
s"Requesting next compact filter headers from $filterSyncMarker")
sendGetCompactFilterHeadersMessage(filterSyncMarker)
.map(_ => true)
case None =>