diff --git a/src/chain.h b/src/chain.h index 7ed6c4b4d..4e5d7e48d 100644 --- a/src/chain.h +++ b/src/chain.h @@ -28,6 +28,7 @@ class CChainPower; #include "pow.h" #include "tinyformat.h" #include "uint256.h" +extern int8_t is_STAKED(const char *chain_name); #include @@ -36,6 +37,8 @@ class CChainPower; static const int SPROUT_VALUE_VERSION = 1001400; static const int SAPLING_VALUE_VERSION = 1010100; extern int32_t ASSETCHAINS_LWMAPOS; +extern char ASSETCHAINS_SYMBOL[65]; +//extern uint64_t ASSETCHAINS_NOTARY_PAY; struct CDiskBlockPos { @@ -532,11 +535,6 @@ public: READWRITE(nBits); READWRITE(nNonce); READWRITE(nSolution); - - // LABS extra blockindex stuff. - // only read/write nNotaryPay if it has a value. This should be backwards compatible with all existing chains. - if ( nNotaryPay != 0 ) - READWRITE(nNotaryPay); // Only read/write nSproutValue if the client version used to create // this index was storing them. @@ -549,6 +547,11 @@ public: if ((s.GetType() & SER_DISK) && (nVersion >= SAPLING_VALUE_VERSION)) { READWRITE(nSaplingValue); } + if ( (s.GetType() & SER_DISK) && (is_STAKED(ASSETCHAINS_SYMBOL) != 0) ) + { + READWRITE(nNotaryPay); + READWRITE(segid); + } } uint256 GetBlockHash() const diff --git a/src/komodo_nk.h b/src/komodo_nk.h index 3c9034dde..ed994c13f 100644 --- a/src/komodo_nk.h +++ b/src/komodo_nk.h @@ -1,7 +1,7 @@ #ifndef KOMODO_NK_H #define KOMODO_NK_H -#define ASSETCHAINS_N 96 -#define ASSETCHAINS_K 5 +#define ASSETCHAINS_N 77 +#define ASSETCHAINS_K 3 #endif diff --git a/src/main.cpp b/src/main.cpp index b8861bf9a..f5b57b364 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3714,11 +3714,11 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin //FlushStateToDisk(); komodo_connectblock(false,pindex,*(CBlock *)&block); // dPoW state update. - if ( ASSETCHAINS_NOTARY_PAY[0] != 0 && pindex->GetHeight() > 10 ) + if ( ASSETCHAINS_NOTARY_PAY[0] != 0 ) { // Update the notary pay with the latest payment. pindex->nNotaryPay = pindex->pprev->nNotaryPay + notarypaycheque; - fprintf(stderr, "total notary pay.%li\n", pindex->nNotaryPay); + //fprintf(stderr, "total notary pay.%li\n", pindex->nNotaryPay); } return true; }