|
|
@ -84,10 +84,10 @@ std::ostream& dev::eth::operator<<(std::ostream& _out, BlockChain const& _bc) |
|
|
|
|
|
|
|
ldb::Slice dev::eth::toSlice(h256 const& _h, unsigned _sub) |
|
|
|
{ |
|
|
|
#if TRUE //ALL_COMPILERS_ARE_CPP11_COMPLIANT
|
|
|
|
static thread_local FixedHash<33> h = _h; |
|
|
|
h[32] = (uint8_t)_sub; |
|
|
|
return (ldb::Slice)h.ref(); |
|
|
|
#if ALL_COMPILERS_ARE_CPP11_COMPLIANT |
|
|
|
static thread_local FixedHash<33> h = _h; |
|
|
|
h[32] = (uint8_t)_sub; |
|
|
|
return (ldb::Slice)h.ref(); |
|
|
|
#else |
|
|
|
static boost::thread_specific_ptr<FixedHash<33>> t_h; |
|
|
|
if (!t_h.get()) |
|
|
@ -100,16 +100,17 @@ ldb::Slice dev::eth::toSlice(h256 const& _h, unsigned _sub) |
|
|
|
|
|
|
|
ldb::Slice dev::eth::toSlice(uint64_t _n, unsigned _sub) |
|
|
|
{ |
|
|
|
#if TRUE //ALL_COMPILERS_ARE_CPP11_COMPLIANT
|
|
|
|
static thread_local FixedHash<33> h; |
|
|
|
toBigEndian(_n, bytesRef(h.data() + 24, 8)); |
|
|
|
h[32] = (uint8_t)_sub; |
|
|
|
return (ldb::Slice)h.ref(); |
|
|
|
#if ALL_COMPILERS_ARE_CPP11_COMPLIANT |
|
|
|
static thread_local FixedHash<33> h; |
|
|
|
toBigEndian(_n, bytesRef(h.data() + 24, 8)); |
|
|
|
h[32] = (uint8_t)_sub; |
|
|
|
return (ldb::Slice)h.ref(); |
|
|
|
#else |
|
|
|
static boost::thread_specific_ptr<FixedHash<33>> t_h; |
|
|
|
if (!t_h.get()) |
|
|
|
t_h.reset(new FixedHash<33>); |
|
|
|
toBigEndian(_n, bytesRef(t_h->data() + 24, 8)); |
|
|
|
bytesRef ref(t_h->data() + 24, 8); |
|
|
|
toBigEndian(_n, ref); |
|
|
|
(*t_h)[32] = (uint8_t)_sub; |
|
|
|
return (ldb::Slice)t_h->ref(); |
|
|
|
#endif |
|
|
@ -377,7 +378,7 @@ tuple<ImportRoute, bool, unsigned> BlockChain::sync(BlockQueue& _bq, OverlayDB c |
|
|
|
r = import(block.verified, _stateDB, ImportRequirements::Everything & ~ImportRequirements::ValidSeal & ~ImportRequirements::CheckUncles); |
|
|
|
fresh += r.liveBlocks; |
|
|
|
dead += r.deadBlocks; |
|
|
|
goodTransactions.reserve(goodTransactions.size() + r.goodTranactions.size()); |
|
|
|
goodTransactions.reserve(goodTransactions.size() + r.goodTranactions.size()); |
|
|
|
std::move(std::begin(r.goodTranactions), std::end(r.goodTranactions), std::back_inserter(goodTransactions)); |
|
|
|
++count; |
|
|
|
} |
|
|
|