Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
more blockfeed tweaks, enhance changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
robby-dermody committed Nov 1, 2015
1 parent ae15306 commit a69a7d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
* v1.3.0 (2015-10-31)
* Fixes periodic `blockfeed` hanging issue (where `counterblock` would still run, but not process new blocks from `counterparty-server`)
* Block processing is much more robust now if an exception is encountered (e.g. counterparty-server goes down). Should prevent additional hanging-type issues
* Tweaked `blockfeed` "caught up" checking logic. Should be more reliable
* Simplified `blockchain` module -- we call API methods on `counterparty-server` now, whereever possible, instead of reimplementing them on `counterblock`
* Enhance the information returned with `GET /_api`
* Enhance the information returned with `GET /_api`. Several new parameters added, including `ERROR` for easier diagnosing of most common error conditions.
* `GET /_api` now returns CORS headers, allowing it to be used with cross domain requests
* Added this `ChangeLog.md` file
* v1.2.0 (2015-09-15)
Expand Down
8 changes: 4 additions & 4 deletions counterblock/lib/blockfeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ def parse_block(block_data):

#work up to what block counterpartyd is at
try:
config.state['cp_caught_up'] = cp_running_info['db_caught_up']

if cp_running_info['last_block']: #should normally exist, unless counterparty-server had an error getting it
assert cp_running_info['last_block']['block_index']
config.state['cp_latest_block_index'] = cp_running_info['last_block']['block_index']
Expand All @@ -254,8 +252,10 @@ def parse_block(block_data):
cp_running_info, config.state['cp_latest_block_index']))
time.sleep(3)
continue
config.state['cp_backend_block_index'] = cp_running_info['bitcoin_block_count']

config.state['cp_backend_block_index'] = cp_running_info['bitcoin_block_count']
config.state['cp_caught_up'] = cp_running_info['db_caught_up']

if config.state['my_latest_block']['block_index'] < config.state['cp_latest_block_index']:
#need to catch up
config.state['caught_up'] = False
Expand Down Expand Up @@ -307,7 +307,7 @@ def parse_block(block_data):
database.rollback(config.state['cp_latest_block_index'] - config.MAX_REORG_NUM_BLOCKS)
else:
#...we may be caught up (to counterpartyd), but counterpartyd may not be (to the blockchain). And if it isn't, we aren't
config.state['caught_up'] = cp_running_info['db_caught_up']
config.state['caught_up'] = config.state['cp_caught_up']

#this logic here will cover a case where we shut down counterblockd, then start it up again quickly...
# in that case, there are no new blocks for it to parse, so config.state['last_message_index'] would otherwise remain 0.
Expand Down

0 comments on commit a69a7d7

Please sign in to comment.