mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Make Rules available outside of Transactors (RIPD-182):
Allows multisign to be enabled with a Feature.
This commit is contained in:
@@ -81,6 +81,9 @@ public:
|
|||||||
// The validated ledger is the last fully validated ledger
|
// The validated ledger is the last fully validated ledger
|
||||||
virtual Ledger::pointer getValidatedLedger () = 0;
|
virtual Ledger::pointer getValidatedLedger () = 0;
|
||||||
|
|
||||||
|
// The Rules are in the last fully validated ledger if there is one.
|
||||||
|
virtual Rules getValidatedRules() = 0;
|
||||||
|
|
||||||
// This is the last ledger we published to clients and can lag the validated
|
// This is the last ledger we published to clients and can lag the validated
|
||||||
// ledger
|
// ledger
|
||||||
virtual Ledger::ref getPublishedLedger () = 0;
|
virtual Ledger::ref getPublishedLedger () = 0;
|
||||||
|
|||||||
@@ -1376,6 +1376,18 @@ public:
|
|||||||
return mValidLedger.get ();
|
return mValidLedger.get ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rules getValidatedRules ()
|
||||||
|
{
|
||||||
|
// Once we have a guarantee that there's always a last validated
|
||||||
|
// ledger then we can dispense with the if.
|
||||||
|
|
||||||
|
// Return the Rules from the last validated ledger.
|
||||||
|
if (auto const ledger = getValidatedLedger())
|
||||||
|
return ledger->rules();
|
||||||
|
|
||||||
|
return Rules();
|
||||||
|
}
|
||||||
|
|
||||||
// This is the last ledger we published to clients and can lag the validated
|
// This is the last ledger we published to clients and can lag the validated
|
||||||
// ledger.
|
// ledger.
|
||||||
Ledger::ref getPublishedLedger ()
|
Ledger::ref getPublishedLedger ()
|
||||||
|
|||||||
Reference in New Issue
Block a user