Hi this is my web3 code

events.watch(function (error,result){
            if (error) {


Here when ever an event occurs it trigger the watch function. But the problem is, it callback the function, twice. How can I prevent this? In every discussion they just said I fixed and closed the thread. What is the solution to stop triggering twice? I'm using web3 0.20.0. Thank you.


You could create a hash list based on the transaction's hash and make sure it was not processed before running the code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.