Avoid spurious BIP30 error in DB consistency checks

Solve a spurious warning generated during fine-grained consensus checks.
Complete
$3,750.00
Check Out Task
Task Bounty Details

22596

Bitcoin Issue

Days

Estimated Effort

Complete

Current Status

$3,750.00

Paid in USD or equivalent BTC upon acceptance

Bitcoin Issue

In `validation.cpp:ConnectBlock()`, duplicate coinbase transactions are accounted for per BIP30. However in `validation.cpp:DisconnectBlock()` there is no such special handling, which causes issues at the two affected blocks when using a high `checklevel=` setting.

Fix `DisconnectBlock()` to account for BIP30 and avoid the related spurious VerifyDB() failures.

See this comment in particular.

Prerequisite Skills

C++

Code Guidelines

Repository Code Guidelines Page

Definition of Done

Get a PR merged which closes the original issue

Check Out Task