Closed coinop-logan closed 5 years ago
Interesting... Not surprising honestly. Spent a fair amount of time thinking about how to prevent this scenario from happening, but looks like I missed a case.
Have links from the relevant parts of your code by chance?
Oh sure: https://github.com/coinop-logan/toastytrade-lite/blob/master/src/Interact/State.elm#L88
That's from the Interact page. When I use the Create page to initialize a trade, it redirects me to the Interact page as soon as the transaction is mined. Then the Interact pages fetches newCreationInfo
, which will then have a blocknum
indicating the block number that the creation call was mined in--which just happened seconds ago.
Let me know if you have any other questions!
Seems to have been something in my code! My apologies!
The event sentry seems to reliably return a duplicate event when the filter's block range is
fromBlock: Latest, toBlock: [the current latest blocknum]
Well, that's my guess. It happens just after I create a new contract, and then immediately nagivate to a page which loads that contract's event history--using its creation block as the
fromBlock
andLatest
as thetoBlock
. If I refresh the page, I never get the duplicate event.