Browse Source

Premature vETH bridge notarization reject fix

pull/446/head
miketout 2 years ago
parent
commit
d823b3fca8
  1. 2
      src/init.cpp
  2. 10
      src/main.cpp
  3. 2
      src/miner.cpp
  4. 6
      src/pbaas/pbaas.cpp
  5. 2
      src/pbaas/pbaas.h

2
src/init.cpp

@ -1831,7 +1831,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
{
// until we have connected to the ETH bridge, after PBaaS has launched, we check each block to see if there is now an
// ETH bridge defined
ConnectedChains.ConfigureEthBridge();
ConnectedChains.ConfigureEthBridge(true);
}
CChainNotarizationData cnd;

10
src/main.cpp

@ -3572,6 +3572,11 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
SetMaxScriptElementSize(nHeight);
if (CConstVerusSolutionVector::GetVersionByHeight(nHeight) >= CActivationHeight::ACTIVATE_PBAAS)
{
ConnectedChains.ConfigureEthBridge();
}
bool fExpensiveChecks = true;
if (fCheckpointsEnabled) {
CBlockIndex *pindexLastCheckpoint = Checkpoints::GetLastCheckpoint(chainparams.Checkpoints());
@ -6683,11 +6688,6 @@ bool ProcessNewBlock(bool from_miner, int32_t height, CValidationState &state, c
SetMaxScriptElementSize(nHeight + 1);
if (CConstVerusSolutionVector::GetVersionByHeight(nHeight) >= CActivationHeight::ACTIVATE_PBAAS)
{
ConnectedChains.ConfigureEthBridge();
}
return true;
}

2
src/miner.cpp

@ -1813,7 +1813,7 @@ CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const std::vecto
}
else
{
notaryConnected = ConnectedChains.ConfigureEthBridge();
notaryConnected = ConnectedChains.ConfigureEthBridge(true);
}
}

6
src/pbaas/pbaas.cpp

@ -3381,7 +3381,7 @@ bool CConnectedChains::IsNotaryAvailable(bool callToCheck)
CheckVerusPBaaSAvailable();
}
bool CConnectedChains::ConfigureEthBridge()
bool CConnectedChains::ConfigureEthBridge(bool callToCheck)
{
// first time through, we initialize the VETH gateway config file
if (!_IsVerusActive())
@ -3395,7 +3395,7 @@ bool CConnectedChains::ConfigureEthBridge()
LOCK(cs_main);
if (FirstNotaryChain().IsValid())
{
return IsNotaryAvailable(true);
return IsNotaryAvailable(callToCheck);
}
CRPCChainData vethNotaryChain;
@ -3437,7 +3437,7 @@ bool CConnectedChains::ConfigureEthBridge()
cnd.vtx.size() ? cnd.vtx[cnd.forks[cnd.bestChain].back()].second : CPBaaSNotarization(),
CNotarySystemInfo::TYPE_ETH,
CNotarySystemInfo::VERSION_CURRENT)));
return IsNotaryAvailable(true);
return IsNotaryAvailable(callToCheck);
}
}
return false;

2
src/pbaas/pbaas.h

@ -988,7 +988,7 @@ public:
bool CheckVerusPBaaSAvailable(); // may use RPC to call Verus
bool IsVerusPBaaSAvailable();
bool IsNotaryAvailable(bool callToCheck=false);
bool ConfigureEthBridge();
bool ConfigureEthBridge(bool callToCheck=false);
std::vector<CCurrencyDefinition> GetMergeMinedChains()
{

Loading…
Cancel
Save