bool Rules::changed (DigestAwareReadView const& ledger) const { if (! impl_) return static_cast<bool>( ledger.digest(keylet::amendments().key)); return impl_->changed(ledger); }
Impl (DigestAwareReadView const& ledger) { auto const k = keylet::amendments(); digest_ = ledger.digest(k.key); if (! digest_) return; auto const sle = ledger.read(k); if (! sle) { // LogicError() ? return; } for (auto const& item : sle->getFieldV256(sfAmendments)) set_.insert(item); }
bool changed (DigestAwareReadView const& ledger) const { auto const digest = ledger.digest(keylet::amendments().key); if (! digest && ! digest_) return false; if (! digest || ! digest_) return true; return *digest != *digest_; }
explicit Impl( DigestAwareReadView const& ledger, std::unordered_set<uint256, beast::uhash<>> const& presets) : presets_(presets) { auto const k = keylet::amendments(); digest_ = ledger.digest(k.key); if (! digest_) return; auto const sle = ledger.read(k); if (! sle) { // LogicError() ? return; } for (auto const& item : sle->getFieldV256(sfAmendments)) set_.insert(item); }