@@ -185,7 +185,7 @@ bool CLASS::is_strong(const tx_link& tx) const NOEXCEPT
185185
186186// protected
187187TEMPLATE
188- error:: error_t CLASS::unspendable (uint32_t sequence, bool coinbase,
188+ code CLASS::unspendable (uint32_t sequence, bool coinbase,
189189 const tx_link& tx, uint32_t version, const context& ctx) const NOEXCEPT
190190{
191191 // Ensure prevout tx is in a strong block, first try self link.
@@ -317,27 +317,27 @@ code CLASS::block_confirmable(const header_link& link) const NOEXCEPT
317317
318318 // Get points for each tx, and sum the total number.
319319 std::transform (parallel, txs.begin (), txs.end (), sets.begin (), to_set);
320- if (failure)
321- return { failure.load () } ;
320+ if (failure != error::success )
321+ return failure.load ();
322322
323323 // Check double spends strength, populates prevout parent tx/cb/sq links.
324324 if ((ec = populate_prevouts (sets, points, link)))
325325 return ec;
326326
327- const auto is_unspendable = [this , &ctx, &failure](const auto & set) NOEXCEPT
327+ const auto is_spendable = [this , &ctx, &failure](const auto & set) NOEXCEPT
328328 {
329- error:: error_t ec{};
329+ code ec{};
330330 for (const auto & point: set.points )
331331 if (!point.tx .is_terminal () && ((ec = unspendable (point.sequence ,
332332 point.coinbase , point.tx , set.version , ctx))))
333- failure.store (ec );
333+ failure.store (static_cast <error:: error_t >(ec. value ()) );
334334
335- return failure ! = error::success;
335+ return failure = = error::success;
336336 };
337337
338338 // Check all spends for spendability (strong, unlocked and mature).
339- if (std::any_of (parallel, sets.begin (), sets.end (), is_unspendable ))
340- return { failure.load () } ;
339+ if (! std::all_of (parallel, sets.begin (), sets.end (), is_spendable ))
340+ return failure.load ();
341341
342342 return error::success;
343343}
0 commit comments