Exemple #1
0
    async def handle_add_xshard_tx_list_request(self, req):
        if req.branch not in self.shards:
            Logger.error("cannot find shard id {} locally".format(
                req.branch.get_full_shard_id()))
            return AddXshardTxListResponse(error_code=errno.ENOENT)

        self.shards[
            req.branch].state.add_cross_shard_tx_list_by_minor_block_hash(
                req.minor_block_hash, req.tx_list)
        return AddXshardTxListResponse(error_code=0)
Exemple #2
0
    async def handle_add_xshard_tx_list_request(self, req):
        if req.branch.get_shard_size() != self.__get_shard_size():
            Logger.error("add xshard tx list request shard size mismatch! "
                         "Expect: {}, actual: {}".format(
                             self.__get_shard_size(),
                             req.branch.get_shard_size()))
            return AddXshardTxListResponse(error_code=errno.ESRCH)

        if req.branch not in self.shards:
            Logger.error("cannot find shard id {} locally".format(
                req.branch.get_shard_id()))
            return AddXshardTxListResponse(error_code=errno.ENOENT)

        self.shards[
            req.branch].state.add_cross_shard_tx_list_by_minor_block_hash(
                req.minor_block_hash, req.tx_list)
        return AddXshardTxListResponse(error_code=0)