Split declaration and definition of SPROUT_BRANCH_ID constant

Fixes an initialization-order-fiasco error detected by ASan:
https://ci.z.cash/#/builders/7/builds/149
This commit is contained in:
Jack Grigg 2018-03-09 09:42:20 +00:00
parent d88a12262c
commit a6ae8f55ae
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
2 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,8 @@ const struct NUInfo NetworkUpgradeInfo[Consensus::MAX_NETWORK_UPGRADES] = {
}
};
const uint32_t SPROUT_BRANCH_ID = NetworkUpgradeInfo[Consensus::BASE_SPROUT].nBranchId;
UpgradeState NetworkUpgradeState(
int nHeight,
const Consensus::Params& params,

View File

@ -27,7 +27,7 @@ struct NUInfo {
extern const struct NUInfo NetworkUpgradeInfo[];
// Consensus branch id to identify pre-overwinter (Sprout) consensus rules.
static const uint32_t SPROUT_BRANCH_ID = NetworkUpgradeInfo[Consensus::BASE_SPROUT].nBranchId;
extern const uint32_t SPROUT_BRANCH_ID;
/**
* Checks the state of a given network upgrade based on block height.