top of page

Counterparty Development Update #8: Code Refactoring, Fixed BTC Dividends and Socket Timeout Issues

December 26, 2014

This is the last development update in 2014, and although it’s the Holiday season, our devs have been working hard on stomping out bugs, refactoring the code and making overall progress.

As our team is growing and our project maturing, we expect some exciting development updates in the upcoming year. For now, let’s look at the changes implemented this week.

Resolving Issue with Socket Timeout

We had a ‘stubborn’ bug with random timeout errors. Most of the hotfixes below address the #554 issue, which has been resolved with the latest commit: One Proxy Per Thread, Passed Around as Parameter. Here are the rest of the changes implemented:

  1. Fixed bug with the error: `AttributeError: 'module' object has no attribute 'BitcoindError'

  2. Implemented passing proxy in blocks.py for efficiency

  3. Removed sharing of backend proxies

  4. Dramatically increased HTTP timeout: python-bitcoinlib’s default is 30 seconds (and Bitcoin Core is sometimes very slow); HTTP timeout has now been set to one hour in config.py. However, this value doesn’t have any effect with python-bitcoinlib before v0.3.0.

  5. Implemented one proxy per thread, passed around as parameter

Other Changes and Fixed

The rest of this week’s changes were also implemented in the counterpartyd repository:

  1. Renamed version.json to protocol_changes.json: old version.json is being kept for backwards‐compatibility

  2. Removed Callback Functionality: Callbacks were never live on mainnet and would be much better implemented in smart contracts. For API changes see the API ChangeLog. This change solves issues #552 and #78

  3. Implemented overwriting the config file only if necessary

  4. Updated Logging System

  5. Share logger across modules

  6. Shutdown logger gracefully

  7. Log logging level

  8. Simplify output

  9. Coloured output (for WARNING, ERROR, CRITICAL)

  10. Tweak logging of transaction skipping, decode errors

  11. minor reformatting of miscellaneous import statements.

  12. Fixed API Status Poller

  13. API Status Poller wasn’t running at all

  14. Improved logging of status polling

  15. Misc. bugs in check.py

  16. Implemented measuring how far behind the backend is in hours: Using seconds, as was done before, involved false precision.

  17. Removed Unnecessary python-bitcoinlib Proxy

  18. Implemented proxy as a required argument to get_tx_info*()

  19. Updated the required version of python-bitcoinlib in pip-requirements.txt to 0.3.0: Solves #551.

  20. Fixed bug with paying dividends in BTC: BTC dividends fail get_tx_info() Sanity Check in transaction.compose() <#558=">#558</a>">

  21. Implemented more elegant skipping of pure BTC transactions: Now, the sanity check in transaction.construct() only skips transactions which raise a particular BTC‐only exception. The use of such an exception distinguishes transactions that cannot be parsed from ones that simply shouldn’t be. (The former type should be caught by the sanity check.)

  22. Fixed Bug introduced with recent logging updates <#560=">#560</a>">

  23. Added package url for python-bitcoinlib in pip-requirements: this package should be used until official upgrade

  24. Made all calls to backend go through backend.py for better abstraction

  25. Removed BTC balance check for orders with give_asset==BTC from message compose function

That covers our development updates for this week. If you have any questions regarding recent or upcoming changes you can contact us via our support channel, forum or github.

In order to stay up to date with our progress subscribe to our newsletter at the bottom of this page and receive weekly updates via email.

Comentarios


bottom of page