Neutrino Logging (#1382)

This commit is contained in:
Ben Carman 2020-04-30 09:05:26 -05:00 committed by GitHub
parent 6d7685b76e
commit fddca91e79
2 changed files with 19 additions and 1 deletions

View file

@ -238,7 +238,13 @@ case class ChainHandler(
}
} else FutureUtil.unit
_ <- filterHeaderDAO.createAll(filterHeadersToCreate)
} yield this
} yield {
val minHeight = filterHeadersToCreate.minBy(_.height)
val maxHeight = filterHeadersToCreate.maxBy(_.height)
logger.info(
s"Processed filters headers from height=${minHeight.height} to ${maxHeight.height}. Best hash=${maxHeight.blockHashBE}")
this
}
}
/** @inheritdoc */
@ -280,6 +286,10 @@ case class ChainHandler(
}
_ <- filterDAO.createAll(compactFilterDbs)
} yield {
val minHeight = compactFilterDbs.minBy(_.height)
val maxHeight = compactFilterDbs.maxBy(_.height)
logger.info(
s"Processed filters from height=${minHeight.height} to ${maxHeight.height}. Best hash=${maxHeight.blockHashBE}")
this
}
}

View file

@ -136,7 +136,15 @@ trait Node extends NodeApi with ChainQueryApi with P2PLogger {
this
}
}
// get chainApi so we don't need to call chainApiFromDb on every call
chainApi <- chainApiFromDb
bestHash <- chainApi.getBestBlockHash()
bestHeight <- chainApi.getBestHashBlockHeight()
filterCount <- chainApi.getFilterCount
filterHeaderCount <- chainApi.getFilterHeaderCount
} yield {
logger.info(
s"Started node, best block hash ${bestHash.hex} at height $bestHeight, with $filterHeaderCount filter headers and $filterCount filers")
node
}
}