blockcollider / bcnode

Mining node and rovers for the five genesis chains of Block Collider.
https://www.blockcollider.org
MIT License
45 stars 23 forks source link

rover.btc.controller Uncaught exception: { stack: [ 'RangeError [ERR_INDEX_OUT_OF_RANGE] #247

Closed Simon0x closed 4 years ago

Simon0x commented 6 years ago

Prerequisites

For more information, see the CONTRIBUTING guide.

Description

The btc controller use sometimes a wrong index to access data.

Steps to Reproduce

  1. Run latest version of the miner

Expected behavior: The data should be checked better so that it is not accessed with an incorrect index.

Actual behavior: Sometimes the btc controller has a IndexOutOfRange exception

Versions

(0.5.5/124bab0)

Application (required)

You can get this information:

Environment (optional but helpful)

Logs

Full Log: telobot.com/YD2o.log

 2018-05-16T13:41:54.466Z ERROR rover.btc.controller Uncaught exception: { stack: 
 [ 'RangeError [ERR_INDEX_OUT_OF_RANGE]: Index out of range',
 'at checkOffset (buffer.js:1015:11)',
 'at Buffer.readUInt32LE (buffer.js:1079:5)',
 'at BufferReader.readUInt64LEBN (/home/bc/bcnode/node_modules/bitcore-lib/lib/encoding/bufferreader.js:100:25)',
 'at Function.Output.fromBufferReader (/home/bc/bcnode/node_modules/bitcore-lib/lib/transaction/output.js:147:21)',
 'at Transaction.fromBufferReader (/home/bc/bcnode/node_modules/bitcore-lib/lib/transaction/transaction.js:312:30)',
 'at Function._fromBufferReader (/home/bc/bcnode/node_modules/bitcore-lib/lib/block/block.js:92:42)',
 'at Function.fromBufferReader (/home/bc/bcnode/node_modules/bitcore-lib/lib/block/block.js:103:20)',
 'at Function.fromBuffer (/home/bc/bcnode/node_modules/bitcore-lib/lib/block/block.js:112:16)',
 'at BlockMessage.setPayload (/home/bc/bcnode/node_modules/bitcore-p2p/lib/messages/commands/block.js:29:27)',
 'at Function.exported.commands.(anonymous function).fromBuffer (/home/bc/bcnode/node_modules/bitcore-p2p/lib/messages/builder.js:75:15)' ],

message: 'Index out of range' }