Example #1
0
	virtual CBlock* getBlock(unsigned int thread_id, unsigned int last_time) {
		boost::unique_lock<boost::shared_mutex> lock(_mutex_getwork);
		if (_blocks == NULL) return NULL;
		CBlock* block = NULL;
		block = new CBlock(_blocks->GetBlockHeader());
		unsigned int new_time = GetAdjustedTimeWithOffset(thread_id);
		if (new_time == last_time)
			new_time += thread_num_max;
		block->nTime = new_time; //TODO: check if this is the same time like before!?
		//std::cout << "[WORKER" << thread_id << "] got_work block=" << block->GetHash().ToString().c_str() << std::endl;
		return block;
	}
Example #2
0
 virtual blockHeader_t* getBlock(unsigned int thread_id, unsigned int last_time, unsigned int counter) {
   blockHeader_t* block = NULL;
   {
     boost::shared_lock<boost::shared_mutex> lock(_mutex_getwork);
     if (_block == NULL) return NULL;
     block = new blockHeader_t;
     memcpy(block, _block, 80+32+8);
   }		
   unsigned int new_time = GetAdjustedTimeWithOffset(thread_id);
   new_time += counter * thread_num_max;
   block->nTime = new_time;
   //std::cout << "[WORKER" << thread_id << "] block @ " << new_time << std::endl;
   return block;
 }
Example #3
0
	virtual blockHeader_t* getBlock(unsigned int thread_id, unsigned int last_time) {
		blockHeader_t* block = NULL;
		{
			boost::shared_lock<boost::shared_mutex> lock(_mutex_getwork);
			if (_block == NULL) return NULL;
			block = new blockHeader_t;
			memcpy(block, _block, 80+32+8);
		}		
		unsigned int new_time = GetAdjustedTimeWithOffset(thread_id);
		if (new_time == last_time)
			new_time += thread_num_max;
		block->nTime = new_time;
		//std::cout << "[WORKER" << thread_id << "] got_work block=" << block->GetHash().ToString().c_str() << std::endl;
		return block;
	}