mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-13 07:23:21 +02:00
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:
@@ -116,8 +116,7 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
|
||||
|
||||
// Estimate the size
|
||||
CMutableTransaction mtx(*psbtx.tx);
|
||||
CCoinsView view_dummy;
|
||||
CCoinsViewCache view(&view_dummy);
|
||||
CCoinsViewCache view{&CoinsViewEmpty::Get()};
|
||||
bool success = true;
|
||||
|
||||
for (unsigned int i = 0; i < psbtx.tx->vin.size(); ++i) {
|
||||
|
||||
Reference in New Issue
Block a user