diff --git a/include/bitcoin/node/impl/chasers/chaser_organize.ipp b/include/bitcoin/node/impl/chasers/chaser_organize.ipp index 48101323..074d8807 100644 --- a/include/bitcoin/node/impl/chasers/chaser_organize.ipp +++ b/include/bitcoin/node/impl/chasers/chaser_organize.ipp @@ -131,9 +131,8 @@ void CLASS::do_organize(typename Block::cptr& block_ptr, BC_ASSERT(stranded()); using namespace system; - const auto& block = *block_ptr; - const auto hash = block.hash(); - const auto header = get_header(block); + const auto hash = block_ptr->hash(); + const auto header = get_header(*block_ptr); auto& query = archive(); // Skip existing/orphan, get state. @@ -217,14 +216,14 @@ void CLASS::do_organize(typename Block::cptr& block_ptr, return; }; - if (const auto ec = validate(block, *state)) + if (const auto ec = validate(*block_ptr, *state)) { handler(ec, height); return; } // Store with checkpoint, milestone, or currency with sufficient work. - if (!is_storable(block, *state)) + if (!is_storable(*block_ptr, *state)) { log_state_change(*parent, *state); cache(block_ptr, state); @@ -321,7 +320,7 @@ void CLASS::do_organize(typename Block::cptr& block_ptr, // Push new header as top of candidate chain. { - if (push(block, state->context()).is_terminal()) + if (push(*block_ptr, state->context()).is_terminal()) { handler(fault(error::node_push), height); return; @@ -408,16 +407,16 @@ void CLASS::do_disorganize(header_t link) NOEXCEPT const auto top_candidate = state_->height(); for (auto index = add1(fork_point); index <= top_candidate; ++index) { - typename Block::cptr block{}; - if (!get_block(block, index)) + typename Block::cptr block_ptr{}; + if (!get_block(block_ptr, index)) { fault(error::get_block); return; } - const auto& header = get_header(*block); + const auto& header = get_header(*block_ptr); state.reset(new chain::chain_state{ *state, header, settings_ }); - cache(block, state); + cache(block_ptr, state); } // Pop candidates from top down to above fork point. diff --git a/src/protocols/protocol_block_in_31800.cpp b/src/protocols/protocol_block_in_31800.cpp index cef79555..348586e2 100644 --- a/src/protocols/protocol_block_in_31800.cpp +++ b/src/protocols/protocol_block_in_31800.cpp @@ -277,8 +277,8 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec, // ........................................................................ auto& query = archive(); - const auto& block = *message->block_ptr; - const auto hash = block.hash(); + const auto& block_ptr = message->block_ptr; + const auto hash = block_ptr->hash(); const auto it = map_->find(hash); if (it == map_->end()) @@ -289,7 +289,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec, return true; } - if (query.is_malleated(block)) + if (query.is_malleated(*block_ptr)) { // Disallow known block malleation, drop peer and keep trying. LOGR("Malleated block [" << encode_hash(hash) << "] from [" @@ -304,11 +304,11 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec, // Check block. // ........................................................................ - if (const auto code = check(block, ctx)) + if (const auto code = check(*block_ptr, ctx)) { // Both forms of malleabilty are possible here. // Malleable has not been associated, so just drop peer and continue. - if (!block.is_malleable()) + if (!block_ptr->is_malleable()) { if (!query.set_block_unconfirmable(link)) { @@ -334,10 +334,10 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec, // Commit block.txs. // ........................................................................ - const auto size = block.serialized_size(true); - const auto& txs = *block.transactions_ptr(); + const auto size = block_ptr->serialized_size(true); + const auto& txs_ptr = block_ptr->transactions_ptr(); - if (const auto code = query.set_code(txs, link, size)) + if (const auto code = query.set_code(*txs_ptr, link, size)) { LOGF("Failure storing block [" << encode_hash(hash) << ":" << ctx.height << "] from [" << authority() << "] "