mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Add NetworkID field to Transaction common fields, enforced when network id > 1024
This commit is contained in:
@@ -138,6 +138,7 @@ public:
|
||||
std::string START_LEDGER;
|
||||
|
||||
// Network parameters
|
||||
uint32_t NETWORK_ID = 0;
|
||||
|
||||
// The number of fee units a reference transaction costs
|
||||
static constexpr FeeUnit32 TRANSACTION_FEE_BASE{10};
|
||||
|
||||
@@ -102,6 +102,7 @@ struct ConfigSection
|
||||
#define SECTION_BETA_RPC_API "beta_rpc_api"
|
||||
#define SECTION_SWEEP_INTERVAL "sweep_interval"
|
||||
#define SECTION_XPOP_HISTORY "xpop_history"
|
||||
#define SECTION_NETWORK_ID "network_id"
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
|
||||
@@ -483,6 +483,18 @@ Config::loadFromString(std::string const& fileContents)
|
||||
|
||||
if (getSingleSection(secConfig, SECTION_XPOP_HISTORY, strTemp, j_))
|
||||
XPOP_HISTORY = beast::lexicalCastThrow<bool>(strTemp);
|
||||
|
||||
if (getSingleSection(secConfig, SECTION_NETWORK_ID, strTemp, j_))
|
||||
{
|
||||
if (strTemp == "main")
|
||||
NETWORK_ID = 0;
|
||||
else if (strTemp == "testnet")
|
||||
NETWORK_ID = 1;
|
||||
else if (strTemp == "devnet")
|
||||
NETWORK_ID = 2;
|
||||
else
|
||||
NETWORK_ID = beast::lexicalCastThrow<uint32_t>(strTemp);
|
||||
}
|
||||
|
||||
if (getSingleSection(secConfig, SECTION_PEER_PRIVATE, strTemp, j_))
|
||||
PEER_PRIVATE = beast::lexicalCastThrow<bool>(strTemp);
|
||||
|
||||
Reference in New Issue
Block a user