Browse Source

Fixes #879.

cl-refactor
Gav Wood 10 years ago
parent
commit
a8ef8c7f24
  1. 6
      libethereum/Client.cpp

6
libethereum/Client.cpp

@ -642,14 +642,20 @@ Transaction Client::transaction(h256 _blockHash, unsigned _i) const
{ {
auto bl = m_bc.block(_blockHash); auto bl = m_bc.block(_blockHash);
RLP b(bl); RLP b(bl);
if (_i < b[1].itemCount())
return Transaction(b[1][_i].data(), CheckSignature::Range); return Transaction(b[1][_i].data(), CheckSignature::Range);
else
return Transaction();
} }
BlockInfo Client::uncle(h256 _blockHash, unsigned _i) const BlockInfo Client::uncle(h256 _blockHash, unsigned _i) const
{ {
auto bl = m_bc.block(_blockHash); auto bl = m_bc.block(_blockHash);
RLP b(bl); RLP b(bl);
if (_i < b[2].itemCount())
return BlockInfo::fromHeader(b[2][_i].data()); return BlockInfo::fromHeader(b[2][_i].data());
else
return BlockInfo();
} }
LocalisedLogEntries Client::logs(LogFilter const& _f) const LocalisedLogEntries Client::logs(LogFilter const& _f) const

Loading…
Cancel
Save