[FEATURE] Fix error with self variable - ready for merge

defined variables
Thanks for your pull request. We appreciate your work and value your newly introduced features. Please keep up the good work!

As this is security-related code and we want to gradually migrate into code that is possible to audit and review for security issues easily, we are trying to adhere to higher standards in the quality of our code.

As part of that, we're aiming for improvement on our [pep8](http://legacy.python.org/dev/peps/pep-0008/) coverage, as well as jslint. We're also gradually introducing unit tests everywhere. While this might not seem important at first glance, coding style is an important part of good quality of code, [as numerous critical issues of the past have shown](https://www.imperialviolet.org/2014/02/22/applebug.html).

Some of our old code is still problematic, as it was written quickly and we inherited some technical debt from a team that rushed to make it work and consisted of experienced programmers, but not experienced with Python. This is the way it should have been done at the time, but now we're aiming to fix that so that we can turn OpenBazaar into production-ready software, and not simply a proof-of-concept. [We're](https://github.com/OpenBazaar/OpenBazaar/pull/568) making [serious](https://github.com/OpenBazaar/OpenBazaar/pull/559) improvements [towards](https://github.com/OpenBazaar/OpenBazaar/pull/280) that [front](https://github.com/OpenBazaar/OpenBazaar/pull/209) and we're hoping that this effort would not be undermined by new code which breaks existing fixes.

We will be introducing checks in the build ensuring some basic code quality as it pertains to styling soon. Currently, this is not possible to do for everything, as not all files and issues have been migrated, but [we have some checks in place](https://github.com/OpenBazaar/OpenBazaar/blob/master/checkstyle.sh) for pep8, excluding long lines. This will change in future pull requests.

As for your arguments for long lines, larger monitors are indeed a feature today, but a lot of people also use split views of code or often work on smaller laptops. Additionally, many of us use code editors that are line-based, especially for automating tasks. These include vim, emacs, and sed. However, this is not an argument to be discussed here, as it's part of pep8 and we decided to follow pep8 – perhaps Guido, Barry and Nick of Python would be interested in your arguments, but this is irrelevant here. 

We prefer to wait a bit for pull requests to be fixed until merged instead of merging something that is half-baked. Introducing features and fixing bugs should not be in contrast with maintaining code quality. Furthermore, waiting a couple of days to be merged should not discourage you – you can still rebase onto master and continue working on your fixes, and eventually you will be merged. There is no rush.

We encourage you to make the fixes suggested and commit them. We're looking forward to merging you and working with you again in the future.

Thanks again!