mirror of
https://github.com/Xahau/xahaud.git
synced 2026-10-16 08:48:13 +00:00
Compare commits
1 Commits
dev
...
fix/standa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8845f4672e |
@@ -1122,6 +1122,36 @@ trustthesevalidators.gov
|
||||
}
|
||||
}
|
||||
|
||||
// Standalone forces ledger_history to zero, but [node_db] type=rwdb
|
||||
// (the null node store) sizes its retained-ledger window from it and
|
||||
// SHAMapStoreImp throws on zero. cfg/rippled.cfg ships exactly this
|
||||
// configuration, and jtx never calls Config::setup, so pin it here.
|
||||
void
|
||||
testSetupStandaloneRwdb()
|
||||
{
|
||||
testcase("setup standalone rwdb keeps ledger_history");
|
||||
|
||||
for (std::string const type : {"rwdb", "NuDB"})
|
||||
{
|
||||
detail::RippledCfgGuard const cfg(
|
||||
*this,
|
||||
"testSetupStandaloneRwdb_" + type,
|
||||
"",
|
||||
"",
|
||||
true,
|
||||
"[node_db]\ntype=" + type + "\npath=main\n");
|
||||
Config config;
|
||||
config.setup(
|
||||
cfg.configFile(),
|
||||
/*bQuiet*/ true,
|
||||
/* bSilent */ true,
|
||||
/* bStandalone */ true);
|
||||
BEAST_EXPECT(config.standalone());
|
||||
BEAST_EXPECT(config.nullBackend() == (type == "rwdb"));
|
||||
BEAST_EXPECT(config.LEDGER_HISTORY == (type == "rwdb" ? 256 : 0));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
testPort()
|
||||
{
|
||||
@@ -1813,6 +1843,7 @@ r.ripple.com:51235
|
||||
testValidatorsFile();
|
||||
testSetup(false);
|
||||
testSetup(true);
|
||||
testSetupStandaloneRwdb();
|
||||
testPort();
|
||||
testZeroPort();
|
||||
testWhitespace();
|
||||
|
||||
@@ -405,7 +405,11 @@ Config::setup(
|
||||
|
||||
HTTPClient::initializeSSLContext(*this, j_);
|
||||
|
||||
if (RUN_STANDALONE)
|
||||
// Standalone never fetches history, so ledger_history is normally
|
||||
// meaningless there. The rwdb null node store (nullBackend) uses it
|
||||
// to size the in-memory retained-ledger window, and SHAMapStoreImp
|
||||
// rejects zero for it, so keep the configured value in that case.
|
||||
if (RUN_STANDALONE && !nullBackend())
|
||||
LEDGER_HISTORY = 0;
|
||||
|
||||
std::string ledgerTxDbType;
|
||||
|
||||
Reference in New Issue
Block a user