Using hard-fork on the blockchain to recover the losses caused by attacks contradicts the immutable characteristic of a blockchain system. To prevent malicious transactions from getting into blockchains in advance, we propose a runtime hook technique to synchronize ongoing transactions exposed to the Ethereum transaction pool. Having a complete view of ongoing transactions, we are able to identify and enforce abortion of malicious transactions and prevent losses due to attacks being executed and recorded in the blockchain. Specifically, we modify the Ethereum source code to instrument the entry point of a node to synchronize information, import information into our local database, and systematically scan suspicious patterns in transactions to identify potential attacks. As a proof-of-theconcept, we show how to deploy the proposed runtime hook system on a private blockchain system, such that we can detect and prevent transactions of double spending on the 51% attack.