Skip to content

restructure coach and retry to fix nonce issues#127

Merged
s4w3d0ff merged 11 commits intomasterfrom
dev
Jun 12, 2017
Merged

restructure coach and retry to fix nonce issues#127
s4w3d0ff merged 11 commits intomasterfrom
dev

Conversation

@s4w3d0ff
Copy link
Copy Markdown
Owner

This is an attempt to fix #125 #122 and make the coach/nonces more thread friendly, more changes are needed, and this branch needs to be tested...

@s4w3d0ff s4w3d0ff added the enhancement New feature or bug fix label Jun 12, 2017
@s4w3d0ff
Copy link
Copy Markdown
Owner Author

If a nonce error occurs, the wrapper will automagicly update the nonce and try again. see #125

Python 2.7.12
[GCC 5.4.0 20160609] on linux2

>>> import poloniex
>>> import logging
>>> logging.basicConfig(level=logging.DEBUG)
>>> polo = poloniex.Poloniex('my-key', 'mysecret', timeout=None)
>>> polo._nonce = 0
>>> polo.returnBalances()['ETH']
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): poloniex.com
DEBUG:requests.packages.urllib3.connectionpool:"POST /tradingApi HTTP/1.1" 422 None
DEBUG:poloniex:{"error":"Nonce must be greater than 1496260118086481. You provided 42."}
DEBUG:poloniex:PoloniexErrorNonce must be greater than 1496260118086481. You provided 42.
INFO:poloniex:-- delaying for 0s
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): poloniex.com
DEBUG:requests.packages.urllib3.connectionpool:"POST /tradingApi HTTP/1.1" 200 None
DEBUG:poloniex:{"1CR":"0.00000000",,,}
u'0.00000000'
>>>

It should also handle/retry connection errors returned from poloniex (#122)

@s4w3d0ff s4w3d0ff merged commit 9d43d89 into master Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nonce must be greater...

1 participant