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

sync.js crashes if tx is undefined #364

Closed
ucacoin opened this issue Mar 16, 2020 · 5 comments
Closed

sync.js crashes if tx is undefined #364

ucacoin opened this issue Mar 16, 2020 · 5 comments

Comments

@ucacoin
Copy link

ucacoin commented Mar 16, 2020

We are using the explorer for our coin. The sync.js crashes if an empty tx is passed to syncloop.

explorer/lib/explorer.js:583
    module.exports.syncLoop(tx.vin.length, function (loop) {
                               ^

TypeError: Cannot read property 'vin' of undefined
    at Object.prepare_vin (/root/explorer/lib/explorer.js:583:32)
    at /root/explorer/lib/database.js:128:11
    at Request._callback (/root/explorer/lib/explorer.js:213:16)
    at self.callback (/root/explorer/node_modules/request/request.js:185:22)
    at Request.emit (events.js:321:20)
    at Request.onRequestError (/root/explorer/node_modules/request/request.js:877:8)
    at ClientRequest.emit (events.js:321:20)
    at TLSSocket.socketErrorListener (_http_client.js:426:9)
    at TLSSocket.emit (events.js:321:20)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

A simple if (tx) {} fixes that.

@uaktags
Copy link
Collaborator

uaktags commented Mar 16, 2020

Why would there be an empty tx?

@ucacoin
Copy link
Author

ucacoin commented Mar 17, 2020

I can't really tell you, we use a pivx based coin and we got this error while doing a reindex. So there seem to be some rare cases where the tx can be undefined.

@Hser2bio
Copy link

@ucacoin

may be you need check if your coin are configured by pos in settings,conf

and make a reindex

@justthedoctor
Copy link

I am having this same issue, if i sync.js index update, however if i reindex it works fine.

@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

5 participants