CityOfZion / neo-scan

Blockchain explorer for NEO
https://neoscan.io
MIT License
70 stars 65 forks source link

Syncing blocks halts on NEP-5 token transfer/mint #354

Closed jeroenptrs closed 6 years ago

jeroenptrs commented 6 years ago

In tested neo-local instances, neo scan stops syncing blocks when performing a transfer implementation (mintTokens, deploy that sends tokens to the owner, transfer, ... ) on a NEP-5 contract.

This was confirmed by @WyattMufson on a separate occasion

WyattMufson commented 6 years ago

I can reproduce the issue on the latest version of neo-local with this repo. I run deploy and then transfer. It might have to do with the fact that when I transfer neo-scan has it so the owner wallet has a negative balance (the initial transfer event is setup wrong) - example wallet

WyattMufson commented 6 years ago

After a little bit more investigation it seems that it's the OnTransfer call that is halting neo-scan. Previously my deploy function didn't cause it to stop even though it was transferring tokens. Once I added the line OnTransfer(None, TOKEN_OWNER, TOKEN_INITIAL_AMOUNT) in the deploy function it now stops neo-scan.

adrienmo commented 6 years ago

Seems the problem comes from the python notification server that returns transfer amount as integer instead of returning it as string for the endpoint http://server/v1/notifications/block/index

WyattMufson commented 6 years ago

Can confirm that the recent release of neo-python fixes the neo-scan issue in neo-local. Opened a PR to update to the newer version https://github.com/CityOfZion/neo-local/pull/67

adrienmo commented 6 years ago

I will close this issue then