Browse Source

Various compile fixes.

cl-refactor
Gav Wood 10 years ago
parent
commit
6e5571fc15
  1. 2
      alethzero/MainWin.cpp
  2. 4
      ethvm/main.cpp
  3. 2
      libethereum/Account.cpp
  4. 2
      libethereum/CanonBlockChain.cpp
  5. 22
      libethereum/Client.cpp
  6. 2
      libweb3jsonrpc/WebThreeStubServer.cpp

2
alethzero/MainWin.cpp

@ -1817,7 +1817,7 @@ void Main::on_dumpBlockState_triggered()
{
f << "{" << endl;
// js::mObject s;
State state = ethereum()->state(h);
State state = ethereum()->block(h).state();
int fi = 0;
for (pair<Address, u256> const& i: state.addresses())
{

4
ethvm/main.cpp

@ -26,7 +26,7 @@
#include <libdevcore/CommonIO.h>
#include <libdevcore/RLP.h>
#include <libdevcore/SHA3.h>
#include <libethereum/State.h>
#include <libethereum/Block.h>
#include <libethereum/Executive.h>
#include <libevm/VM.h>
#include <libevm/VMFactory.h>
@ -84,7 +84,7 @@ int main(int argc, char** argv)
Address sender = Address(69);
Address origin = Address(69);
u256 value = 0;
u256 gas = state.gasLimitRemaining();
u256 gas = Block().gasLimitRemaining();
u256 gasPrice = 0;
bool styledJson = true;
StandardTrace st;

2
libethereum/Account.cpp

@ -44,7 +44,7 @@ AccountMap dev::eth::jsonToAccountMap(std::string const& _json, AccountMaskMap*
js::mValue val;
json_spirit::read_string(_json, val);
for (auto account: val.get_obj())
for (auto account: val.get_obj().count("alloc") ? val.get_obj()["alloc"].get_obj() : val.get_obj())
{
Address a(fromHex(account.first));
auto o = account.second.get_obj();

2
libethereum/CanonBlockChain.cpp

@ -29,12 +29,14 @@
#include <libethcore/BlockInfo.h>
#include <libethcore/Params.h>
#include <liblll/Compiler.h>
#include <test/JsonSpiritHeaders.h>
#include "GenesisInfo.h"
#include "State.h"
#include "Defaults.h"
using namespace std;
using namespace dev;
using namespace dev::eth;
namespace js = json_spirit;
unique_ptr<Ethash::BlockHeader> CanonBlockChain<Ethash>::s_genesis;
boost::shared_mutex CanonBlockChain<Ethash>::x_genesis;

22
libethereum/Client.cpp

@ -81,6 +81,11 @@ Client::Client(std::shared_ptr<GasPricer> _gp):
{
}
Client::~Client()
{
stopWorking();
}
void Client::init(p2p::Host* _extNet, std::string const& _dbPath, WithExisting _forceAction, u256 _networkId)
{
// Cannot be opened until after blockchain is open, since BlockChain may upgrade the database.
@ -115,9 +120,20 @@ void Client::init(p2p::Host* _extNet, std::string const& _dbPath, WithExisting _
startWorking();
}
Client::~Client()
Block Client::asOf(h256 const& _block) const
{
stopWorking();
try
{
Block ret(m_stateDB);
ret.populateFromChain(bc(), _block);
return ret;
}
catch (Exception& ex)
{
ex << errinfo_block(bc().block(_block));
onBadBlock(ex);
return Block();
}
}
ImportResult Client::queueBlock(bytes const& _block, bool _isSafe)
@ -654,7 +670,7 @@ void Client::resyncStateFromChain()
void Client::resetState()
{
State newPreMine;
Block newPreMine;
DEV_READ_GUARDED(x_preMine)
newPreMine = m_preMine;

2
libweb3jsonrpc/WebThreeStubServer.cpp

@ -219,7 +219,7 @@ bool WebThreeStubServer::admin_eth_setMiningBenefactor(std::string const& _uuidO
if (m_setMiningBenefactor)
m_setMiningBenefactor(a);
else
m_web3.ethereum()->setAddress(a);
m_web3.ethereum()->setBeneficiary(a);
return true;
}

Loading…
Cancel
Save