Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property '0' of undefined #346

Closed
admecoin opened this issue Jan 25, 2020 · 4 comments
Closed

TypeError: Cannot read property '0' of undefined #346

admecoin opened this issue Jan 25, 2020 · 4 comments

Comments

@admecoin
Copy link

admecoin commented Jan 25, 2020

Error
I can’t synchronize to the end of the explorer. Error:

TypeError: Cannot read property '0' of undefined
at /root/explorer/lib/explorer.js:290:74
at Object.next (/root/explorer/lib/explorer.js:189:18)
at Object.syncLoop (/root/explorer/lib/explorer.js:205:10)
at Object.prepare_vout (/root/explorer/lib/explorer.js:284:20)
at /root/explorer/lib/database.js:141:17
at /root/explorer/lib/explorer.js:396:14
at Object.next (/root/explorer/lib/explorer.js:194:24)
at /root/explorer/lib/explorer.js:382:22
at Object.convert_to_satoshi (/root/explorer/lib/explorer.js:25:12)
at /root/explorer/lib/explorer.js:380:30
at /root/explorer/lib/explorer.js:263:14
at Object.next (/root/explorer/lib/explorer.js:194:24)
at Object.syncLoop (/root/explorer/lib/explorer.js:205:10)
at Object.is_unique (/root/explorer/lib/explorer.js:252:20)
at /root/explorer/lib/explorer.js:378:26
at /root/explorer/lib/explorer.js:362:20

@minkcrypto-zz
Copy link
Contributor

Try loading block 1 at your explorer page please

@admecoin
Copy link
Author

246873 blocks are already synchronized, further synchronization is interrupted. Total blocks over 400,000

@uaktags
Copy link
Collaborator

uaktags commented Feb 11, 2020

I'm guessing you're on 1.6.x of iquidus,
I can't begin to guess what coin you're using,
etc

please include more details about the error and the environment. Are you able to sync at all (you could reindex, but gets stuck at a certain height), can you not sync at all, etc?

Eitherway, the issue is within the prepare_vout function

        module.exports.is_unique(arr_vout, vout[i].scriptPubKey.addresses[0], function(unique, index) {

So the error is saying that there's no addresses in vout[i].scriptPubKey when there should be. So it failed here. The explorer can't/doesn't know how to react to this missing data. Check what that transaction would be and see what's the json looking like for the scriptPubKey addresses.

@TheHolyRoger
Copy link
Collaborator

Dup of #56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants