mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-20 10:13:26 +01:00
Fix empty.tail
exception occurring on chain block filter / filter headers callbacks (#5021)
* Fix empty.tail exception occurring on chain block filter / filter headers callbacks * scalafmt
This commit is contained in:
parent
e3e1c7f949
commit
6b03133a34
@ -112,7 +112,9 @@ object WebsocketUtil extends Logging {
|
||||
val emitBlockProccessedWhileIBDOnGoing =
|
||||
chainAppConfig.ibdBlockProcessedEvents
|
||||
isIBDF.flatMap { isIBD =>
|
||||
if (isIBD && !emitBlockProccessedWhileIBDOnGoing) {
|
||||
if (
|
||||
isIBD && !emitBlockProccessedWhileIBDOnGoing && filterHeaders.nonEmpty
|
||||
) {
|
||||
val notifications =
|
||||
CompactFilterHeaderProcessedNotification(filterHeaders.last)
|
||||
sendHeadersToWs(Vector(notifications), queue)
|
||||
@ -130,7 +132,9 @@ object WebsocketUtil extends Logging {
|
||||
val emitBlockProccessedWhileIBDOnGoing =
|
||||
chainAppConfig.ibdBlockProcessedEvents
|
||||
isIBDF.flatMap { isIBD =>
|
||||
if (isIBD && !emitBlockProccessedWhileIBDOnGoing) {
|
||||
if (
|
||||
isIBD && !emitBlockProccessedWhileIBDOnGoing && filters.nonEmpty
|
||||
) {
|
||||
val notifications = CompactFilterProcessedNotification(filters.last)
|
||||
sendHeadersToWs(Vector(notifications), queue)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user