为什么这段NodeJs代码在Win7上会出现蓝屏?

问题描述

我实际上是在 nodejs 中玩区块链(使用 WebStorm IDE)。 以下代码在 Win7 上产生了“BAD_POOL_CALLER”蓝屏。你知道为什么吗?谢谢。

# upgrade PyTorch to the nightly release (change it accordingly)
python -m pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html

git clone https://github.com/pytorch/pytorch

cd pytorch/docs/

make latexpdf

解决方法

我认为使用 setTimeout 函数改进了处理......不确定但现在似乎工作得更好一些。这远非完美,因为我面临另一个问题,但似乎我走在正确的道路上:

// Parcourir tous les blocs entre bloc courant et bloc-1000 et lister 
// toutes les transactions de chaque bloc,avec temporisation de 5 
// secondes entre chaque bloc.

let index = 0
web3.eth.getBlockNumber().then(blockNumber => {
    for (let i = blockNumber - 1000; i <= blockNumber; i++) {
        setTimeout(function(index) {
            getBlockInfo(i).then()
            console.log('next')
            console.log("index=" + index)
        },5000 * index,index)
        index = index+1
    }
});

async function getBlockInfo(i) {
    await web3.eth.getBlock(i).then(block => {
        block.transactions.forEach(function (t) {
            web3.eth.getTransaction(t).then(transaction => {
                console.log(i + ' ' + transaction.hash + ' ' + transaction.from + ' ' + transaction.to)
            }).catch((error) => {
                console.log('erreur')
            })
        })
    }).catch((error) => {console.log(error)})
}

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...