示例#1
0
bool
Rules::changed (DigestAwareReadView const& ledger) const
{
    if (! impl_)
        return static_cast<bool>(
            ledger.digest(keylet::amendments().key));
    return impl_->changed(ledger);
}
示例#2
0
 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_;
 }
示例#3
0
    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);
    }
示例#4
0
    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);
    }