Browse Source

Fixed 1970

More frequent chain updates.
cl-refactor
Gav Wood 10 years ago
parent
commit
c8c22fcfbd
  1. 2
      libethereum/Client.cpp
  2. 14
      libweb3jsonrpc/WebThreeStubServerBase.cpp

2
libethereum/Client.cpp

@ -484,7 +484,7 @@ void Client::syncBlockQueue()
cwork << "BQ ==> CHAIN ==> STATE"; cwork << "BQ ==> CHAIN ==> STATE";
{ {
tie(ir.first, ir.second, m_syncBlockQueue) = m_bc.sync(m_bq, m_stateDB, 100); tie(ir.first, ir.second, m_syncBlockQueue) = m_bc.sync(m_bq, m_stateDB, 10);
if (ir.first.empty()) if (ir.first.empty())
return; return;
} }

14
libweb3jsonrpc/WebThreeStubServerBase.cpp

@ -99,11 +99,12 @@ static Json::Value toJson(dev::eth::Transaction const& _t, std::pair<h256, unsig
return res; return res;
} }
static Json::Value toJson(dev::eth::BlockInfo const& _bi, UncleHashes const& _us, Transactions const& _ts) static Json::Value toJson(dev::eth::BlockInfo const& _bi, BlockDetails const& _bd, UncleHashes const& _us, Transactions const& _ts)
{ {
Json::Value res = toJson(_bi); Json::Value res = toJson(_bi);
if (_bi) if (_bi)
{ {
res["totalDifficulty"] = toJS(_bd.totalDifficulty);
res["uncles"] = Json::Value(Json::arrayValue); res["uncles"] = Json::Value(Json::arrayValue);
for (h256 h: _us) for (h256 h: _us)
res["uncles"].append(toJS(h)); res["uncles"].append(toJS(h));
@ -114,11 +115,12 @@ static Json::Value toJson(dev::eth::BlockInfo const& _bi, UncleHashes const& _us
return res; return res;
} }
static Json::Value toJson(dev::eth::BlockInfo const& _bi, UncleHashes const& _us, TransactionHashes const& _ts) static Json::Value toJson(dev::eth::BlockInfo const& _bi, BlockDetails const& _bd, UncleHashes const& _us, TransactionHashes const& _ts)
{ {
Json::Value res = toJson(_bi); Json::Value res = toJson(_bi);
if (_bi) if (_bi)
{ {
res["totalDifficulty"] = toJS(_bd.totalDifficulty);
res["uncles"] = Json::Value(Json::arrayValue); res["uncles"] = Json::Value(Json::arrayValue);
for (h256 h: _us) for (h256 h: _us)
res["uncles"].append(toJS(h)); res["uncles"].append(toJS(h));
@ -602,9 +604,9 @@ Json::Value WebThreeStubServerBase::eth_getBlockByHash(string const& _blockHash,
{ {
auto h = jsToFixed<32>(_blockHash); auto h = jsToFixed<32>(_blockHash);
if (_includeTransactions) if (_includeTransactions)
return toJson(client()->blockInfo(h), client()->uncleHashes(h), client()->transactions(h)); return toJson(client()->blockInfo(h), client()->blockDetails(h), client()->uncleHashes(h), client()->transactions(h));
else else
return toJson(client()->blockInfo(h), client()->uncleHashes(h), client()->transactionHashes(h)); return toJson(client()->blockInfo(h), client()->blockDetails(h), client()->uncleHashes(h), client()->transactionHashes(h));
} }
catch (...) catch (...)
{ {
@ -618,9 +620,9 @@ Json::Value WebThreeStubServerBase::eth_getBlockByNumber(string const& _blockNum
{ {
auto h = jsToBlockNumber(_blockNumber); auto h = jsToBlockNumber(_blockNumber);
if (_includeTransactions) if (_includeTransactions)
return toJson(client()->blockInfo(h), client()->uncleHashes(h), client()->transactions(h)); return toJson(client()->blockInfo(h), client()->blockDetails(h), client()->uncleHashes(h), client()->transactions(h));
else else
return toJson(client()->blockInfo(h), client()->uncleHashes(h), client()->transactionHashes(h)); return toJson(client()->blockInfo(h), client()->blockDetails(h), client()->uncleHashes(h), client()->transactionHashes(h));
} }
catch (...) catch (...)
{ {

Loading…
Cancel
Save