mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-15 12:10:12 +02:00
feat: round verification_progress value in SSE
Bitcoin Core calculates the blockchain verification by including unconfirmed transactions. This means that everytime there is a new transaction, a `btc_info` event is fired through the SSE channel. For clients this information is usually not useful beyond two digits. Solution: round to two digits for SSE events. The full floating point value can still be fetched through `/bitcoin/get-blockhain-info` closes #52
This commit is contained in:
parent
71f87e06d7
commit
a7dfe14aea
1 changed files with 1 additions and 0 deletions
|
|
@ -77,6 +77,7 @@ async def _handle_gather_bitcoin_status():
|
|||
while True:
|
||||
try:
|
||||
info = await get_btc_info()
|
||||
info.verification_progress = round(info.verification_progress, 2)
|
||||
except HTTPException as e:
|
||||
print(e)
|
||||
await asyncio.sleep(2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue