Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 6a14802

Browse files
committed
Return the result of add_transaction when it's called again due to a new head_candidate
1 parent be56376 commit 6a14802

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ethereum/chain.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def add_transaction(self, transaction):
345345
log.debug('add tx', num_txs=self.num_transactions(), tx=transaction, on=head_candidate)
346346
if self.head_candidate.includes_transaction(transaction.hash):
347347
log.debug('known tx')
348-
return
348+
return False
349349
old_state_root = head_candidate.state_root
350350
# revert finalization
351351
head_candidate.state_root = self.pre_finalize_state_root
@@ -363,8 +363,7 @@ def add_transaction(self, transaction):
363363
# we might have a new head_candidate (due to ctx switches in pyethapp)
364364
if self.head_candidate != head_candidate:
365365
log.debug('head_candidate changed during validation, trying again')
366-
self.add_transaction(transaction)
367-
return
366+
return self.add_transaction(transaction)
368367

369368
self.pre_finalize_state_root = head_candidate.state_root
370369
head_candidate.finalize()

0 commit comments

Comments
 (0)