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

Block difficulty configurable via queryString for blocks tab #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/javascripts/blockchain.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var difficulty = 4; // number of zeros required at front of hash
var difficulty = window.location.search.split("?difficulty=")[1] || 4;// number of zeros required at front of hash
var maximumNonce = 500000; // limit the nonce to this so we don't mine too long

// NOTE: Because there are 16 possible characters in a hex value, each time you increment
Expand Down
2 changes: 1 addition & 1 deletion views/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ html
li(class={active: page === 'hash'})
a(href='/hash') #{__('Hash')}
li(class={active: page === 'block'})
a(href='/block') #{__('Block')}
a(href='/block?difficulty=4') #{__('Block')}
li(class={active: page === 'blockchain'})
a(href='/blockchain') #{__('Blockchain')}
li(class={active: page === 'distributed'})
Expand Down