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

get_block_coinbase (rename to view_coinbase)? #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

get_block_coinbase (rename to view_coinbase)? #90

wants to merge 1 commit into from

Conversation

wizardofozzie
Copy link
Contributor

  1. get_block_coinbase(inp) returns block's coinbase text
    inp=0, "EThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
    inp=142573, "'Eligius7Militant atheists, http://bit.ly/naNhG2 -- happy now?'")
  2. lambda st, by functions added (for cross-version encoding)
  3. make_request returns bytes in Python 3, encoded as string , lest json.loads fail

1. get_block_coinbase(inp) returns block's coinbase text 
   inp=0,          "EThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
   inp=142573, "'Eligius7Militant atheists, http://bit.ly/naNhG2 -- happy now?'")
2. lambda st, by functions added (for cross-version encoding)
3. make_request returns bytes in Python 3, encoded as string \, lest json.loads fail
@wizardofozzie
Copy link
Contributor Author

Has anyone got a better way to check the coinbase field and filter out non-printable characters? ie, note the 'E' in front of the block 0 coinbase text returned, or the random chars here @ 142573

@MiWCryptoCurrency
Copy link
Contributor

I like it for py3 support, a much better way to convert to str, better than having to touch all the json.loads().

this seems like a good fragment for filtering non-printable?
cbtxt = ''.join(c for c in cb if c in string.printable)

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

Successfully merging this pull request may close these issues.

2 participants