Skip to content
This repository has been archived by the owner on Aug 8, 2018. It is now read-only.

Commit

Permalink
Accept peers without DAO header
Browse files Browse the repository at this point in the history
If the peer returns empty header list as the dao answer, it may be because the peer is not in Mainnet or the peer hasn't finished syncing yet.
  • Loading branch information
hwwhww committed Oct 30, 2017
1 parent 05d8037 commit b1aa95b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyethapp/eth_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ def run(self):
try:
dao_headers = self.deferred.get(block=True, timeout=self.request_timeout)
log.debug("received DAO challenge answer", proto=self.proto, answer=dao_headers)
result = len(dao_headers) == 1 and \
# Accept peers without DAO header
result = len(dao_headers) == 0 or (
dao_headers[0].hash == self.config['DAO_FORK_BLKHASH'] and \
dao_headers[0].extra_data == self.config['DAO_FORK_BLKEXTRA']
)
self.chainservice.on_dao_challenge_answer(self.proto, result)
except gevent.Timeout:
log.debug('challenge dao timed out', proto=self.proto)
Expand Down

0 comments on commit b1aa95b

Please sign in to comment.