Closed
Description
While trying web3.eth.isSyncing()
, a function which gives you callbacks when the node start and stops syncing i found an issue when using it as follows:
web3.eth.isSyncing(function(error, sync){
if(!error) {
if(sync === true) {
// stop all activity
web3.reset(true); // <--- this seems to crash it
} else if(sync) {
// show sync info, stop app calls etc
console.log(sync.highestBlock);
} else {
// regain app operation
}
}
});
This will crash the go node with the following:
runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow
see: https://gist.github.com/frozeman/d4df07d674150bddec8e
If you call it as follows, no problem appear:
web3.eth.isSyncing(function(error, sync){
if(!error) {
if(sync === true) {
// stop all activity
console.log('start syncing');
} else if(sync) {
// show sync info, stop app calls etc
console.log(sync.currentBlock);
} else {
// regain app operation
console.log('stop syncing');
}
}
});
@bas-vk could this have to do with the IPC?
@zsfelfoldi could this have to do with your implementation of the setInterval
, as web3 is polling under the hood using setInterval?