Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

khashier crashes showing blocks 0 and 1 #93

Closed
dooglus opened this issue Dec 11, 2014 · 2 comments
Closed

khashier crashes showing blocks 0 and 1 #93

dooglus opened this issue Dec 11, 2014 · 2 comments

Comments

@dooglus
Copy link
Collaborator

dooglus commented Dec 11, 2014

Block 2 is OK:

http://khashier.com/block/0000042f7f9811948352d2ecc9215916f2276a5259ca4cdc4ccfb77a72ed8ebc

but block 1 isn't:

http://khashier.com/block/00000feca63cbde350712358668e0fe90e96c97efab3f0ff5fd9f3147dd2f53e

screenshot - 14-12-11 - 09 04 56 am

@dooglus
Copy link
Collaborator Author

dooglus commented Dec 11, 2014

I fixed it like this:

diff --git a/Abe/abe.py b/Abe/abe.py
index 3aeb033..8d920d3 100755
--- a/Abe/abe.py
+++ b/Abe/abe.py
@@ -627,7 +627,7 @@ class Abe:
             body += ['<tr><td>Average Coin Age</td><td>',(b['satoshi_seconds'] / 86400.0 / b['chain_satoshis']),' days']
         if b['satoshis_destroyed'] is not None:
             body += ['<tr><td>Coin-days Destroyed</td><td>',format_satoshis(b['satoshis_destroyed'] / 86400.0, chain),'</td></tr>']
-        if b['chain_satoshi_seconds'] is not None:
+        if b['chain_satoshi_seconds'] is not None and b['chain_satoshi_seconds']:
             body += ['<tr><td>Cumulative Coin-days Destroyed</td><td>',(100 * (1 - float(b['satoshi_seconds']) / b['chain_satoshi_seconds']))]
         body += ['<tr><td>Short Link</td><td>', abe.short_link(page, 'b/' + block_shortlink(b['hash'])), '</td></tr>']
         body += ['</tbody></table></div>']

It will need checking in to git, but it appears to work.

@dooglus
Copy link
Collaborator Author

dooglus commented Dec 11, 2014

Just:

if b['chain_satoshi_seconds']:

should suffice, in fact.

Edit: yup - that's working.

@dooglus dooglus closed this as completed Dec 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant