mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Enable amendments in genesis ledger (RIPD-1281)
When started with "--start", put all known, non-vetoed amendments in the genesis ledger. This avoids the need to wait 256 ledgers before amendments are enabled when testing with a fresh ledger.
This commit is contained in:
@@ -186,7 +186,11 @@ public:
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Ledger::Ledger (create_genesis_t, Config const& config, Family& family)
|
||||
Ledger::Ledger (
|
||||
create_genesis_t,
|
||||
Config const& config,
|
||||
std::vector<uint256> const& amendments,
|
||||
Family& family)
|
||||
: mImmutable (false)
|
||||
, txMap_ (std::make_shared <SHAMap> (SHAMapType::TRANSACTION,
|
||||
family, SHAMap::version{1}))
|
||||
@@ -205,6 +209,14 @@ Ledger::Ledger (create_genesis_t, Config const& config, Family& family)
|
||||
sle->setAccountID (sfAccount, id);
|
||||
sle->setFieldAmount (sfBalance, info_.drops);
|
||||
rawInsert(sle);
|
||||
|
||||
if (! amendments.empty())
|
||||
{
|
||||
auto const sle = std::make_shared<SLE>(keylet::amendments());
|
||||
sle->setFieldV256 (sfAmendments, STVector256{amendments});
|
||||
rawInsert(sle);
|
||||
}
|
||||
|
||||
stateMap_->flushDirty (hotACCOUNT_NODE, info_.seq);
|
||||
setImmutable(config);
|
||||
}
|
||||
|
||||
@@ -94,8 +94,14 @@ public:
|
||||
of XRP in the system. No more XRP than the amount which
|
||||
starts in this account can ever exist, with amounts
|
||||
used to pay fees being destroyed.
|
||||
|
||||
Amendments specified are enabled in the genesis ledger
|
||||
*/
|
||||
Ledger (create_genesis_t, Config const& config, Family& family);
|
||||
Ledger (
|
||||
create_genesis_t,
|
||||
Config const& config,
|
||||
std::vector<uint256> const& amendments,
|
||||
Family& family);
|
||||
|
||||
Ledger (
|
||||
LedgerInfo const& info,
|
||||
|
||||
Reference in New Issue
Block a user