coins: add explicit CoinsViewEmpty noop backend

Introduce `CoinsViewEmpty` as an explicit no-op `CCoinsView` implementation, and define its singleton accessor out of line in `coins.cpp` to avoid `-Wunique-object-duplication` in shared-library builds.`
Use it at call sites that intentionally want a no-op backend instead of constructing anonymous placeholder views.

`CCoinsViewTest` and `CoinsViewBottom` now inherit defaults from `CoinsViewEmpty` (e.g. the unused `EstimateSize()`, which now returns 0).

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
This commit is contained in:
Lőrinc
2026-02-15 15:16:27 +01:00
parent 90c635c01c
commit b637566c8d
15 changed files with 54 additions and 63 deletions

View File

@@ -86,8 +86,7 @@ FUZZ_TARGET(transaction, .init = initialize_transaction)
(void)RecursiveDynamicUsage(tx);
(void)SignalsOptInRBF(tx);
CCoinsView coins_view;
const CCoinsViewCache coins_view_cache(&coins_view);
const CCoinsViewCache coins_view_cache{&CoinsViewEmpty::Get()};
(void)ValidateInputsStandardness(tx, coins_view_cache);
(void)IsWitnessStandard(tx, coins_view_cache);