add notary pay stuff without breaking blockindex.
This commit is contained in:
13
src/chain.h
13
src/chain.h
@@ -28,6 +28,7 @@ class CChainPower;
|
|||||||
#include "pow.h"
|
#include "pow.h"
|
||||||
#include "tinyformat.h"
|
#include "tinyformat.h"
|
||||||
#include "uint256.h"
|
#include "uint256.h"
|
||||||
|
extern int8_t is_STAKED(const char *chain_name);
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@@ -36,6 +37,8 @@ class CChainPower;
|
|||||||
static const int SPROUT_VALUE_VERSION = 1001400;
|
static const int SPROUT_VALUE_VERSION = 1001400;
|
||||||
static const int SAPLING_VALUE_VERSION = 1010100;
|
static const int SAPLING_VALUE_VERSION = 1010100;
|
||||||
extern int32_t ASSETCHAINS_LWMAPOS;
|
extern int32_t ASSETCHAINS_LWMAPOS;
|
||||||
|
extern char ASSETCHAINS_SYMBOL[65];
|
||||||
|
//extern uint64_t ASSETCHAINS_NOTARY_PAY;
|
||||||
|
|
||||||
struct CDiskBlockPos
|
struct CDiskBlockPos
|
||||||
{
|
{
|
||||||
@@ -532,11 +535,6 @@ public:
|
|||||||
READWRITE(nBits);
|
READWRITE(nBits);
|
||||||
READWRITE(nNonce);
|
READWRITE(nNonce);
|
||||||
READWRITE(nSolution);
|
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
|
// Only read/write nSproutValue if the client version used to create
|
||||||
// this index was storing them.
|
// this index was storing them.
|
||||||
@@ -549,6 +547,11 @@ public:
|
|||||||
if ((s.GetType() & SER_DISK) && (nVersion >= SAPLING_VALUE_VERSION)) {
|
if ((s.GetType() & SER_DISK) && (nVersion >= SAPLING_VALUE_VERSION)) {
|
||||||
READWRITE(nSaplingValue);
|
READWRITE(nSaplingValue);
|
||||||
}
|
}
|
||||||
|
if ( (s.GetType() & SER_DISK) && (is_STAKED(ASSETCHAINS_SYMBOL) != 0) )
|
||||||
|
{
|
||||||
|
READWRITE(nNotaryPay);
|
||||||
|
READWRITE(segid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint256 GetBlockHash() const
|
uint256 GetBlockHash() const
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef KOMODO_NK_H
|
#ifndef KOMODO_NK_H
|
||||||
#define KOMODO_NK_H
|
#define KOMODO_NK_H
|
||||||
|
|
||||||
#define ASSETCHAINS_N 96
|
#define ASSETCHAINS_N 77
|
||||||
#define ASSETCHAINS_K 5
|
#define ASSETCHAINS_K 3
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -3714,11 +3714,11 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
|||||||
|
|
||||||
//FlushStateToDisk();
|
//FlushStateToDisk();
|
||||||
komodo_connectblock(false,pindex,*(CBlock *)&block); // dPoW state update.
|
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.
|
// Update the notary pay with the latest payment.
|
||||||
pindex->nNotaryPay = pindex->pprev->nNotaryPay + notarypaycheque;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user