|
88 | 88 | from chia.util.db_synchronous import db_synchronous_on |
89 | 89 | from chia.util.db_version import lookup_db_version, set_db_version_async |
90 | 90 | from chia.util.db_wrapper import DBWrapper2, manage_connection |
91 | | -from chia.util.errors import ConsensusError, Err, TimestampError |
| 91 | +from chia.util.errors import ConsensusError, Err, TimestampError, ValidationError |
92 | 92 | from chia.util.limited_semaphore import LimitedSemaphore |
93 | 93 | from chia.util.network import is_localhost |
94 | 94 | from chia.util.path import path_from_root |
@@ -503,11 +503,16 @@ async def _handle_one_transaction(self, entry: TransactionQueueEntry) -> None: |
503 | 503 | except asyncio.CancelledError: |
504 | 504 | error_stack = traceback.format_exc() |
505 | 505 | self.log.debug(f"Cancelling _handle_one_transaction, closing: {error_stack}") |
| 506 | + except ValidationError as e: |
| 507 | + self.log.exception("Error in _handle_one_transaction, closing") |
| 508 | + if peer is not None: |
| 509 | + await peer.close(CONSENSUS_ERROR_BAN_SECONDS) |
| 510 | + entry.done.set((MempoolInclusionStatus.FAILED, e.code)) |
506 | 511 | except Exception: |
507 | | - error_stack = traceback.format_exc() |
508 | | - self.log.error(f"Error in _handle_one_transaction, closing: {error_stack}") |
| 512 | + self.log.exception("Error in _handle_one_transaction, closing") |
509 | 513 | if peer is not None: |
510 | 514 | await peer.close(CONSENSUS_ERROR_BAN_SECONDS) |
| 515 | + entry.done.set((MempoolInclusionStatus.FAILED, Err.UNKNOWN)) |
511 | 516 | finally: |
512 | 517 | self.add_transaction_semaphore.release() |
513 | 518 |
|
|
0 commit comments