File tree Expand file tree Collapse file tree
include/bitcoin/system/chain Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ class BC_API block
9898 bool is_segregated () const NOEXCEPT;
9999 size_t serialized_size (bool witness) const NOEXCEPT;
100100 size_t signature_operations (bool bip16, bool bip141) const NOEXCEPT;
101+ size_t segregated () const NOEXCEPT;
101102
102103 // / Computed malleation properties.
103104 bool is_malleable () const NOEXCEPT;
Original file line number Diff line number Diff line change @@ -587,6 +587,16 @@ bool block::is_segregated() const NOEXCEPT
587587 return std::any_of (txs_->begin (), txs_->end (), segregated);
588588}
589589
590+ size_t block::segregated () const NOEXCEPT
591+ {
592+ const auto count_segregated = [](const auto & tx) NOEXCEPT
593+ {
594+ return tx->is_segregated ();
595+ };
596+
597+ return std::count_if (txs_->begin (), txs_->end (), count_segregated);
598+ }
599+
590600// The witness merkle root is obtained from wtxids, subject to malleation just
591601// as the txs commitment. However, since tx duplicates are precluded by the
592602// malleable32 (or complete) block check, there is no opportunity for this.
Original file line number Diff line number Diff line change @@ -460,6 +460,7 @@ BOOST_AUTO_TEST_CASE(block__hash__default__matches_header_hash)
460460// is_malleable
461461// is_segregated
462462// serialized_size
463+ // segregated
463464
464465// validation (public)
465466// ----------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments