Skip to content

Commit 9db49dd

Browse files
committed
Remove self check from unspent_duplicates.
1 parent e66e357 commit 9db49dd

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

include/bitcoin/database/impl/query/confirm.ipp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,10 @@ code CLASS::unspent_duplicates(const header_link& link,
387387
// [txs.find, {tx.iterate}, strong_tx.it]
388388
auto coinbases = to_strong_txs(get_tx_key(to_coinbase(link)));
389389

390-
// Found only this block's coinbase instance, no duplicates.
391-
if (is_one(coinbases.size()))
390+
// Current block is not set strong.
391+
if (is_zero(coinbases.size()))
392392
return error::success;
393393

394-
// Remove self (will be not found if current block is not set_strong).
395-
const auto self = std::find(coinbases.begin(), coinbases.end(), link);
396-
if (self == coinbases.end() || coinbases.erase(self) == coinbases.end())
397-
return error::integrity;
398-
399394
// [point.first, is_spent_prevout()]
400395
const auto spent = [this](const auto& tx) NOEXCEPT
401396
{

0 commit comments

Comments
 (0)