mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 13:43:43 +01:00
CountDistinctClusters: nullptrs disallowed
This commit is contained in:
@@ -1880,7 +1880,7 @@ TxGraph::GraphIndex TxGraphImpl::CountDistinctClusters(std::span<const Ref* cons
|
|||||||
std::vector<Cluster*> clusters;
|
std::vector<Cluster*> clusters;
|
||||||
clusters.reserve(refs.size());
|
clusters.reserve(refs.size());
|
||||||
for (const Ref* ref : refs) {
|
for (const Ref* ref : refs) {
|
||||||
if (ref == nullptr) continue;
|
Assume(ref);
|
||||||
if (GetRefGraph(*ref) == nullptr) continue;
|
if (GetRefGraph(*ref) == nullptr) continue;
|
||||||
Assume(GetRefGraph(*ref) == this);
|
Assume(GetRefGraph(*ref) == this);
|
||||||
auto cluster = FindCluster(GetRefIndex(*ref), level);
|
auto cluster = FindCluster(GetRefIndex(*ref), level);
|
||||||
|
|||||||
@@ -159,8 +159,8 @@ public:
|
|||||||
virtual std::strong_ordering CompareMainOrder(const Ref& a, const Ref& b) noexcept = 0;
|
virtual std::strong_ordering CompareMainOrder(const Ref& a, const Ref& b) noexcept = 0;
|
||||||
/** Count the number of distinct clusters that the specified transactions belong to. If
|
/** Count the number of distinct clusters that the specified transactions belong to. If
|
||||||
* main_only is false and a staging graph exists, staging clusters are counted. Otherwise,
|
* main_only is false and a staging graph exists, staging clusters are counted. Otherwise,
|
||||||
* main clusters are counted. Refs that do not exist in the queried graph are ignored. The
|
* main clusters are counted. Refs that do not exist in the queried graph are ignored. Refs
|
||||||
* queried graph must not be oversized. */
|
* can not be null. The queried graph must not be oversized. */
|
||||||
virtual GraphIndex CountDistinctClusters(std::span<const Ref* const>, bool main_only = false) noexcept = 0;
|
virtual GraphIndex CountDistinctClusters(std::span<const Ref* const>, bool main_only = false) noexcept = 0;
|
||||||
|
|
||||||
/** Perform an internal consistency check on this object. */
|
/** Perform an internal consistency check on this object. */
|
||||||
|
|||||||
Reference in New Issue
Block a user