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:
Stefan Stammberger 2021-11-28 08:58:07 +01:00
parent 71f87e06d7
commit a7dfe14aea
No known key found for this signature in database
GPG key ID: 645FA807E935D9D5

View file

@ -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)