uaktags / explorer

An open source block explorer
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

Cannot read property 'length' of undefined #48

Open minkcrypto-zz opened 5 years ago

minkcrypto-zz commented 5 years ago
    at /home/ubuntu/.explorer/lib/database.js:831:78
    at Request._callback (/home/ubuntu/.explorer/lib/explorer.js:223:16)
    at Request.self.callback (/home/ubuntu/.explorer/node_modules/request/request.js:185:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/home/ubuntu/.explorer/node_modules/request/request.js:1161:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/home/ubuntu/.explorer/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickCallback (internal/process/next_tick.js:181:9)

This happens while syncing

minkcrypto-zz commented 5 years ago

I think this crash happens when syncing blocks with big transactions ( maybe 100 recipient or something ), it doesn't happen with original iquidus.

uaktags commented 5 years ago

That doesn't quite make sense with what's happening in that code segment:

https://github.com/uaktags/explorer/blob/06d8229a97548633dd1de8b013b37b22f93c28bd/lib/database.js#L822-L831

What this is saying is that there's no such thing as "block.tx" which means that "block" itself, if it is an actual JSON object containing a block, doesn't include any transactions.

can you get it to output the block itself console.log(block); and perhaps the blockhash as well?