6 changed files with 18 additions and 71 deletions
@ -1,66 +0,0 @@ |
|||||
/*
|
|
||||
This file is part of cpp-ethereum. |
|
||||
|
|
||||
cpp-ethereum is free software: you can redistribute it and/or modify |
|
||||
it under the terms of the GNU General Public License as published by |
|
||||
the Free Software Foundation, either version 3 of the License, or |
|
||||
(at your option) any later version. |
|
||||
|
|
||||
cpp-ethereum is distributed in the hope that it will be useful, |
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
GNU General Public License for more details. |
|
||||
|
|
||||
You should have received a copy of the GNU General Public License |
|
||||
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|
||||
*/ |
|
||||
/** @file Common.h
|
|
||||
* @author Gav Wood <i@gavwood.com> |
|
||||
* @date 2014 |
|
||||
* |
|
||||
* Ethereum-specific data structures & algorithms. |
|
||||
*/ |
|
||||
|
|
||||
#pragma once |
|
||||
|
|
||||
#include <string> |
|
||||
#include <functional> |
|
||||
#include <libdevcore/Common.h> |
|
||||
#include <libdevcore/Exceptions.h> |
|
||||
#include <libdevcore/FixedHash.h> |
|
||||
|
|
||||
namespace dev |
|
||||
{ |
|
||||
namespace eth |
|
||||
{ |
|
||||
|
|
||||
/// An Ethereum address: 20 bytes.
|
|
||||
/// @NOTE This is not endian-specific; it's just a bunch of bytes.
|
|
||||
using Address = h160; |
|
||||
|
|
||||
DEV_SIMPLE_EXCEPTION(InvalidAddress); |
|
||||
|
|
||||
/// The log bloom's size (2048-bit).
|
|
||||
using LogBloom = h2048; |
|
||||
|
|
||||
/// Many log blooms.
|
|
||||
using LogBlooms = std::vector<LogBloom>; |
|
||||
|
|
||||
using Nonce = h64; |
|
||||
|
|
||||
using BlockNumber = unsigned; |
|
||||
|
|
||||
// TODO: move back into a mining subsystem and have it be accessible from Sealant only via a dynamic_cast.
|
|
||||
/**
|
|
||||
* @brief Describes the progress of a mining operation. |
|
||||
*/ |
|
||||
struct WorkingProgress |
|
||||
{ |
|
||||
// MiningProgress& operator+=(MiningProgress const& _mp) { hashes += _mp.hashes; ms = std::max(ms, _mp.ms); return *this; }
|
|
||||
uint64_t hashes = 0; ///< Total number of hashes computed.
|
|
||||
uint64_t ms = 0; ///< Total number of milliseconds of mining thus far.
|
|
||||
uint64_t rate() const { return ms == 0 ? 0 : hashes * 1000 / ms; } |
|
||||
}; |
|
||||
|
|
||||
} |
|
||||
} |
|
Loading…
Reference in new issue