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

Ensure the opened config file gets closed and that an HTTP(S) connection is made before RPC call #1

Merged
merged 2 commits into from Dec 20, 2017

Conversation

GoldenChrysus
Copy link
Contributor

@GoldenChrysus GoldenChrysus commented Dec 19, 2017

Issue 1
The _parse_config() function in bitcoind.py opens a file object but never closes it. If another program using pifkoin instantiates Bitcoind enough times, the system will eventually throw a "too many files open" error due to the constant opening without closing of files by pifkoin.

Issue 2
Making requests to the established HTTP(S)Connection several seconds apart (in this case, 60 seconds) causes BadStatusLine to be thrown because the connection is no longer established. Python documentation states that .connect() is called by default before every request, but this does not seem to be the case. Explicitly calling self._rpc_conn.connect() before the request in _rpc_call() resolves the issue.

@GoldenChrysus GoldenChrysus changed the title Ensure the opened config file gets closed Ensure the opened config file gets closed and that an HTTP connection is made before RPC call Dec 19, 2017
@GoldenChrysus GoldenChrysus changed the title Ensure the opened config file gets closed and that an HTTP connection is made before RPC call Ensure the opened config file gets closed and that an HTTP(S) connection is made before RPC call Dec 19, 2017
Copy link
Owner

@dpifke dpifke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for catching this! LGTM

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.

None yet

2 participants