Fix Ubuntu 24 daemon build errors
This commit is contained in:
@@ -26,6 +26,9 @@
|
|||||||
#define _(x) std::string(x) /* Keep the _() around in case gettext or such will be used later to translate non-UI */
|
#define _(x) std::string(x) /* Keep the _() around in case gettext or such will be used later to translate non-UI */
|
||||||
static const int DEFAULT_HTTP_CLIENT_TIMEOUT=900;
|
static const int DEFAULT_HTTP_CLIENT_TIMEOUT=900;
|
||||||
|
|
||||||
|
using std::runtime_error;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
std::string HelpMessageCli()
|
std::string HelpMessageCli()
|
||||||
{
|
{
|
||||||
string strUsage;
|
string strUsage;
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,6 @@
|
|||||||
#include "libzerocoin/Params.h"
|
#include "libzerocoin/Params.h"
|
||||||
|
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "chainparamsseeds.h"
|
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "utilstrencodings.h"
|
#include "utilstrencodings.h"
|
||||||
@@ -26,6 +25,8 @@ struct SeedSpec6 {
|
|||||||
uint16_t port;
|
uint16_t port;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#include "chainparamsseeds.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main network
|
* Main network
|
||||||
*/
|
*/
|
||||||
|
|||||||
+4
-2
@@ -343,14 +343,16 @@ bool static Bind(const CService& addr, unsigned int flags)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boost::signals2::connection rpcBlockNotifyConnection;
|
||||||
|
|
||||||
void OnRPCStarted()
|
void OnRPCStarted()
|
||||||
{
|
{
|
||||||
uiInterface.NotifyBlockTip.connect(RPCNotifyBlockChange);
|
rpcBlockNotifyConnection = uiInterface.NotifyBlockTip.connect(RPCNotifyBlockChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnRPCStopped()
|
void OnRPCStopped()
|
||||||
{
|
{
|
||||||
uiInterface.NotifyBlockTip.disconnect(RPCNotifyBlockChange);
|
rpcBlockNotifyConnection.disconnect();
|
||||||
//RPCNotifyBlockChange(0);
|
//RPCNotifyBlockChange(0);
|
||||||
cvBlockChange.notify_all();
|
cvBlockChange.notify_all();
|
||||||
LogPrint("rpc", "RPC stopped.\n");
|
LogPrint("rpc", "RPC stopped.\n");
|
||||||
|
|||||||
+3
-4
@@ -253,7 +253,7 @@ bool GetKernelStakeModifier(uint256 hashBlockFrom, uint64_t& nStakeModifier, int
|
|||||||
nStakeModifierTime = pindexFrom->GetBlockTime();
|
nStakeModifierTime = pindexFrom->GetBlockTime();
|
||||||
|
|
||||||
// Enforce PoS start height
|
// Enforce PoS start height
|
||||||
if (pindexFrom->nHeight < Params().PoSStartHeight()) {
|
if (pindexFrom->nHeight < Params().FIRST_POS_BLOCK()) {
|
||||||
return error("GetKernelStakeModifier(): PoS not active at block height %d", pindexFrom->nHeight);
|
return error("GetKernelStakeModifier(): PoS not active at block height %d", pindexFrom->nHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,8 +310,8 @@ bool Stake(CStakeInput* stakeInput, unsigned int nBits, unsigned int nTimeBlockF
|
|||||||
int nHeightStart = chainActive.Height();
|
int nHeightStart = chainActive.Height();
|
||||||
|
|
||||||
// Ensure staking begins at the correct height
|
// Ensure staking begins at the correct height
|
||||||
if (nHeightStart < Params().PoSStartHeight()) {
|
if (nHeightStart < Params().FIRST_POS_BLOCK()) {
|
||||||
return error("Stake(): PoS staking attempted before allowed start height %d", Params().PoSStartHeight());
|
return error("Stake(): PoS staking attempted before allowed start height %d", Params().FIRST_POS_BLOCK());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Params().NetworkID() != CBaseChainParams::REGTEST) {
|
if (Params().NetworkID() != CBaseChainParams::REGTEST) {
|
||||||
@@ -501,4 +501,3 @@ bool CheckStakeModifierCheckpoints(int nHeight, unsigned int nStakeModifierCheck
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-8
@@ -4109,13 +4109,9 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo
|
|||||||
return state.Invalid(error("CheckBlock() : block timestamp too far in the future"),
|
return state.Invalid(error("CheckBlock() : block timestamp too far in the future"),
|
||||||
REJECT_INVALID, "time-too-new");
|
REJECT_INVALID, "time-too-new");
|
||||||
|
|
||||||
// Add concurrent PoW and PoS validation logic
|
// Add concurrent PoW and PoS validation logic. Height-dependent PoS/PoW
|
||||||
|
// window checks are handled in ConnectBlock, where block height is known.
|
||||||
if (block.IsProofOfWork() || block.IsProofOfStake()) {
|
if (block.IsProofOfWork() || block.IsProofOfStake()) {
|
||||||
// Allow PoS starting at block 2
|
|
||||||
if (block.IsProofOfStake() && block.GetBlockHeight() < 2)
|
|
||||||
return state.DoS(100, error("CheckBlock() : PoS not allowed before block 2"),
|
|
||||||
REJECT_INVALID, "bad-pos-before-2");
|
|
||||||
|
|
||||||
// Ensure the block is valid as PoW or PoS
|
// Ensure the block is valid as PoW or PoS
|
||||||
if (!block.IsProofOfWork() && !block.IsProofOfStake())
|
if (!block.IsProofOfWork() && !block.IsProofOfStake())
|
||||||
return state.DoS(100, error("CheckBlock() : Invalid block type, not PoW or PoS"),
|
return state.DoS(100, error("CheckBlock() : Invalid block type, not PoW or PoS"),
|
||||||
@@ -4928,7 +4924,7 @@ bool ProcessNewBlock(CValidationState& state, CNode* pfrom, CBlock* pblock, CDis
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TestBlockValidity(CValidationState& state, const CBlock& block, CBlockIndex* const pindexPrev, bool fCheckPOW, bool fCheckMerkleRoot)
|
bool TestBlockValidity(CValidationState& state, const CBlock& block, CBlockIndex* const pindexPrev, bool fCheckPOW, bool fCheckMerkleRoot, bool fCheckSig)
|
||||||
{
|
{
|
||||||
AssertLockHeld(cs_main);
|
AssertLockHeld(cs_main);
|
||||||
assert(pindexPrev);
|
assert(pindexPrev);
|
||||||
@@ -4945,7 +4941,7 @@ bool TestBlockValidity(CValidationState& state, const CBlock& block, CBlockIndex
|
|||||||
// NOTE: CheckBlockHeader is called by CheckBlock
|
// NOTE: CheckBlockHeader is called by CheckBlock
|
||||||
if (!ContextualCheckBlockHeader(block, state, pindexPrev))
|
if (!ContextualCheckBlockHeader(block, state, pindexPrev))
|
||||||
return false;
|
return false;
|
||||||
if (!CheckBlock(block, state, fCheckPOW, fCheckMerkleRoot))
|
if (!CheckBlock(block, state, fCheckPOW, fCheckMerkleRoot, fCheckSig))
|
||||||
return false;
|
return false;
|
||||||
if (!ContextualCheckBlock(block, state, pindexPrev))
|
if (!ContextualCheckBlock(block, state, pindexPrev))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ public:
|
|||||||
CMasternodePaymentWinner() : vinMasternode(CTxIn()), nBlockHeight(0), payee(CScript()), vchSig() {}
|
CMasternodePaymentWinner() : vinMasternode(CTxIn()), nBlockHeight(0), payee(CScript()), vchSig() {}
|
||||||
explicit CMasternodePaymentWinner(const CTxIn& vinIn) : vinMasternode(vinIn), nBlockHeight(0), payee(CScript()), vchSig() {}
|
explicit CMasternodePaymentWinner(const CTxIn& vinIn) : vinMasternode(vinIn), nBlockHeight(0), payee(CScript()), vchSig() {}
|
||||||
|
|
||||||
uint256 GetHash()
|
uint256 GetHash() const
|
||||||
{
|
{
|
||||||
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
|
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
|
||||||
ss << payee;
|
ss << payee;
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ UniValue getbestblockhash(const UniValue& params, bool fHelp)
|
|||||||
return chainActive.Tip()->GetBlockHash().GetHex();
|
return chainActive.Tip()->GetBlockHash().GetHex();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RPCNotifyBlockChange(const uint256 hashBlock)
|
void RPCNotifyBlockChange(const uint256& hashBlock)
|
||||||
{
|
{
|
||||||
CBlockIndex* pindex = nullptr;
|
CBlockIndex* pindex = nullptr;
|
||||||
pindex = mapBlockIndex.at(hashBlock);
|
pindex = mapBlockIndex.at(hashBlock);
|
||||||
@@ -1654,4 +1654,3 @@ UniValue getblockindexstats(const UniValue& params, bool fHelp) {
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -355,6 +355,6 @@ bool StartRPC();
|
|||||||
void InterruptRPC();
|
void InterruptRPC();
|
||||||
void StopRPC();
|
void StopRPC();
|
||||||
std::string JSONRPCExecBatch(const UniValue& vReq);
|
std::string JSONRPCExecBatch(const UniValue& vReq);
|
||||||
void RPCNotifyBlockChange(const uint256 nHeight);
|
void RPCNotifyBlockChange(const uint256& hashBlock);
|
||||||
|
|
||||||
#endif // BITCOIN_RPCSERVER_H
|
#endif // BITCOIN_RPCSERVER_H
|
||||||
|
|||||||
+1
-1
@@ -90,7 +90,7 @@ public:
|
|||||||
bool ReadCoinSpend(const uint256& hashSerial, uint256 &txHash);
|
bool ReadCoinSpend(const uint256& hashSerial, uint256 &txHash);
|
||||||
bool EraseCoinMint(const CBigNum& bnPubcoin);
|
bool EraseCoinMint(const CBigNum& bnPubcoin);
|
||||||
bool EraseCoinSpend(const CBigNum& bnSerial);
|
bool EraseCoinSpend(const CBigNum& bnSerial);
|
||||||
bool WipeCoins(std::string strType);
|
bool WipeCoins(const std::string& strType);
|
||||||
bool WriteAccumulatorValue(const uint32_t& nChecksum, const CBigNum& bnValue);
|
bool WriteAccumulatorValue(const uint32_t& nChecksum, const CBigNum& bnValue);
|
||||||
bool ReadAccumulatorValue(const uint32_t& nChecksum, CBigNum& bnValue);
|
bool ReadAccumulatorValue(const uint32_t& nChecksum, CBigNum& bnValue);
|
||||||
bool EraseAccumulatorValue(const uint32_t& nChecksum);
|
bool EraseAccumulatorValue(const uint32_t& nChecksum);
|
||||||
|
|||||||
@@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
#include "validationinterface.h"
|
#include "validationinterface.h"
|
||||||
|
|
||||||
|
using boost::placeholders::_1;
|
||||||
|
using boost::placeholders::_2;
|
||||||
|
|
||||||
static CMainSignals g_signals;
|
static CMainSignals g_signals;
|
||||||
|
|
||||||
CMainSignals& GetMainSignals()
|
CMainSignals& GetMainSignals()
|
||||||
|
|||||||
Reference in New Issue
Block a user