pyEVM-github代码笔记-2-func:`~~ eth.chains.base.MiningChain.mine_block

func:`~~ eth.chains.base.MiningChain.mine_block是Py_EVM的挖矿函数

    def mine_block(self, *args: Any, **kwargs: Any) -> BaseBlock:
        """
        Mines the current block. Proxies to the current Virtual Machine.
        See VM. :meth:`~eth.vm.base.VM.mine_block`
        """
        mined_block = self.get_vm(self.header).mine_block(*args, **kwargs)

        self.validate_block(mined_block)

        self.chaindb.persist_block(mined_block)
        self.header = self.ensure_header()
        return mined_block

mine_block(self, *args, **kwargs):func:`~~ vm.base.VM.mine_block`

    def mine_block(self, *args: Any, **kwargs: Any) -> BaseBlock:
        """
        Mines the current block. Proxies to the current Virtual Machine.
        See VM. :meth:`~eth.vm.base.VM.mine_block`
        """
        mined_block = self.get_vm(self.header).mine_block(*args, **kwargs)

        self.validate_block(mined_block)

        self.chaindb.persist_block(mined_block)
        self.header = self.ensure_header()
        return mined_block

猜你喜欢

转载自blog.csdn.net/liudaoqiang_tj/article/details/82010744
今日推荐