Merge branch 'jl777' into nSPV
This commit is contained in:
@@ -68,8 +68,13 @@ void komodo_cbopretupdate(int32_t forceflag);
|
||||
|
||||
void WaitForShutdown(boost::thread_group* threadGroup)
|
||||
{
|
||||
int32_t i; bool fShutdown = ShutdownRequested();
|
||||
int32_t i,height; bool fShutdown = ShutdownRequested(); const uint256 zeroid;
|
||||
// Tell the main threads to shutdown.
|
||||
if (komodo_currentheight()>KOMODO_EARLYTXID_HEIGHT && KOMODO_EARLYTXID!=zeroid && ((height=tx_height(KOMODO_EARLYTXID))==0 || height>KOMODO_EARLYTXID_HEIGHT))
|
||||
{
|
||||
fprintf(stderr,"error: earlytx must be before block height 100 or tx does not exist\n");
|
||||
StartShutdown();
|
||||
}
|
||||
if ( ASSETCHAINS_CBOPRET != 0 )
|
||||
komodo_pricesinit();
|
||||
while (!fShutdown)
|
||||
|
||||
@@ -86,12 +86,12 @@ pegs CC is able to create a coin backed (by any supported coin with gateways CC
|
||||
*/
|
||||
|
||||
// start of consensus code
|
||||
#ifndef PEGS_TRSHOLDS
|
||||
#define PEGS_TRSHOLDS
|
||||
#ifndef PEGS_THRESHOLDS
|
||||
#define PEGS_THRESHOLDS
|
||||
#define PEGS_ACCOUNT_YELLOW_ZONE 60
|
||||
#define PEGS_ACCOUNT_TRESHOLD 90
|
||||
#define PEGS_GLOBAL_TRESHOLD 60
|
||||
#endif // PEGS_TRSHOLDS
|
||||
#define PEGS_ACCOUNT_THRESHOLD 90
|
||||
#define PEGS_GLOBAL_THRESHOLD 60
|
||||
#endif // PEGS_THRESHOLDS
|
||||
#define CC_MARKER_VALUE 10000
|
||||
|
||||
extern uint64_t ASSETCHAINS_PEGSCCPARAMS[3];
|
||||
@@ -1154,9 +1154,9 @@ std::string PegsLiquidate(uint64_t txfee,uint256 pegstxid, uint256 tokenid, uint
|
||||
LOGSTREAM("pegscc",CCLOG_INFO, stream << CCerror << std::endl);
|
||||
return("");
|
||||
}
|
||||
if (PegsGetAccountRatio(pegstxid,tokenid,liquidatetxid)<(ASSETCHAINS_PEGSCCPARAMS[0]?ASSETCHAINS_PEGSCCPARAMS[0]:PEGS_ACCOUNT_TRESHOLD) || PegsGetGlobalRatio(pegstxid)<(ASSETCHAINS_PEGSCCPARAMS[1]?ASSETCHAINS_PEGSCCPARAMS[1]:PEGS_GLOBAL_TRESHOLD))
|
||||
if (PegsGetAccountRatio(pegstxid,tokenid,liquidatetxid)<(ASSETCHAINS_PEGSCCPARAMS[0]?ASSETCHAINS_PEGSCCPARAMS[0]:PEGS_ACCOUNT_THRESHOLD) || PegsGetGlobalRatio(pegstxid)<(ASSETCHAINS_PEGSCCPARAMS[1]?ASSETCHAINS_PEGSCCPARAMS[1]:PEGS_GLOBAL_THRESHOLD))
|
||||
{
|
||||
CCerror = strprintf("not able to liquidate account until account ratio > %lu%% and global ratio > %lu%%",(ASSETCHAINS_PEGSCCPARAMS[0]?ASSETCHAINS_PEGSCCPARAMS[0]:PEGS_ACCOUNT_TRESHOLD),(ASSETCHAINS_PEGSCCPARAMS[1]?ASSETCHAINS_PEGSCCPARAMS[1]:PEGS_GLOBAL_TRESHOLD));
|
||||
CCerror = strprintf("not able to liquidate account until account ratio > %lu%% and global ratio > %lu%%",(ASSETCHAINS_PEGSCCPARAMS[0]?ASSETCHAINS_PEGSCCPARAMS[0]:PEGS_ACCOUNT_THRESHOLD),(ASSETCHAINS_PEGSCCPARAMS[1]?ASSETCHAINS_PEGSCCPARAMS[1]:PEGS_GLOBAL_THRESHOLD));
|
||||
LOGSTREAM("pegscc",CCLOG_INFO, stream << CCerror << std::endl);
|
||||
return("");
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#define KOMODO_DEFS_H
|
||||
#include "komodo_nk.h"
|
||||
|
||||
#define KOMODO_EARLYTXID_HEIGHT 200
|
||||
#define ASSETCHAINS_MINHEIGHT 128
|
||||
#define ASSETCHAINS_MAX_ERAS 7
|
||||
#define KOMODO_ELECTION_GAP 2000
|
||||
|
||||
@@ -1787,13 +1787,7 @@ void komodo_args(char *argv0)
|
||||
{
|
||||
printf("KOMODO_REWIND %d\n",KOMODO_REWIND);
|
||||
}
|
||||
KOMODO_EARLYTXID = Parseuint256(GetArg("-earlytxid","0").c_str());
|
||||
CTransaction tx; uint256 blockhash;
|
||||
if (KOMODO_EARLYTXID!=zeroid && myGetTransaction(KOMODO_EARLYTXID,tx,blockhash) && (mapBlockIndex[blockhash]->GetHeight() == 0 || mapBlockIndex[blockhash]->GetHeight() > 100))
|
||||
{
|
||||
fprintf(stderr,"error: earlytx can be only in first 100 blocks or tx does not exist\n");
|
||||
StartShutdown();
|
||||
}
|
||||
KOMODO_EARLYTXID = Parseuint256(GetArg("-earlytxid","0").c_str());
|
||||
ASSETCHAINS_EARLYTXIDCONTRACT = GetArg("-ac_earlytxidcontract",0);
|
||||
if ( name.c_str()[0] != 0 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user