Skip to content

Commit d2dde8f

Browse files
authored
Merge pull request #1006 from HathorNetwork/fix/duplicate-push-tx
refactor(api): prevent duplicate tx earlier
2 parents 631f2ca + e6c68da commit d2dde8f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hathor/manager.py

+3
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,9 @@ def push_tx(self, tx: Transaction, allow_non_standard_script: bool = False,
908908
max_output_script_size: int | None = None) -> None:
909909
"""Used by all APIs that accept a new transaction (like push_tx)
910910
"""
911+
if self.tx_storage.transaction_exists(tx.hash):
912+
raise InvalidNewTransaction('Transaction already exists {}'.format(tx.hash_hex))
913+
911914
if max_output_script_size is None:
912915
max_output_script_size = self._settings.PUSHTX_MAX_OUTPUT_SCRIPT_SIZE
913916

0 commit comments

Comments
 (0)