35 explicit BasicGasPricer(
u256 _weiPerRef,
u256 _refsPerBlock): m_weiPerRef(_weiPerRef), m_refsPerBlock(_refsPerBlock) {}
37 void setRefPrice(
u256 _weiPerRef) {
if ((
bigint)m_refsPerBlock * _weiPerRef > std::numeric_limits<u256>::max() ) BOOST_THROW_EXCEPTION(Overflow() <<
errinfo_comment(
"ether price * block fees is larger than 2**256-1, choose a smaller number.") );
else m_weiPerRef = _weiPerRef; }
38 void setRefBlockFees(
u256 _refsPerBlock) {
if ((
bigint)m_weiPerRef * _refsPerBlock > std::numeric_limits<u256>::max() ) BOOST_THROW_EXCEPTION(Overflow() <<
errinfo_comment(
"ether price * block fees is larger than 2**256-1, choose a smaller number.") );
else m_refsPerBlock = _refsPerBlock; }
40 u256 ask(
Block const&)
const override {
return m_weiPerRef * m_refsPerBlock / m_gasPerBlock; }
48 u256 m_gasPerBlock = DefaultBlockGasLimit;
49 std::array<u256, 9> m_octiles;
Implements the blockchain database. All data this gives is disk-backed. .
u256 ask(Block const &) const override
Active model of a block within the block chain. Keeps track of all transactions, receipts and state f...
boost::multiprecision::number< boost::multiprecision::cpp_int_backend<> > bigint
void update(BlockChain const &_bc) override
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void > > u256
u256 bid(TransactionPriority _p=TransactionPriority::Medium) const override
boost::error_info< struct tag_comment, std::string > errinfo_comment
void setRefPrice(u256 _weiPerRef)
BasicGasPricer(u256 _weiPerRef, u256 _refsPerBlock)
void setRefBlockFees(u256 _refsPerBlock)