Skip to content

Commit

Permalink
Fix TypeError in BlockQueue.push() #341 (#342)
Browse files Browse the repository at this point in the history
* fix TypeError #341

* use f-string to display fork
  • Loading branch information
only-dev-time authored Oct 5, 2024
1 parent f2d4cad commit 3fd055f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hive/steem/block/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ def push(self, block):
next_hash = block['block_id']
next_prev = block['previous']
if self._prev != next_prev:
fork = "%s--> %s->%s" % (self._prev, next_prev, next_hash)
fork = f"{self._prev}--> {next_prev}->{next_hash}"
if self._queue: # if using max_size>0, fork might be in buffer only
buff = self.size()
alert = "NOTIFYALERT " if buff < self._max_size else ""
raise MicroForkException("%squeue:%d %s" % (alert, fork, buff))
raise MicroForkException(f"{alert}queue:{buff} {fork}")
raise ForkException("NOTIFYALERT fork " + fork)

self._prev = next_hash
Expand Down

0 comments on commit 3fd055f

Please sign in to comment.