@@ -1654,7 +1654,7 @@ extern int64_t MAX_MONEY;
|
|||||||
void komodo_args(char *argv0)
|
void komodo_args(char *argv0)
|
||||||
{
|
{
|
||||||
extern const char *Notaries_elected1[][2];
|
extern const char *Notaries_elected1[][2];
|
||||||
std::string name,addn; char *dirname,fname[512],arg0str[64],magicstr[9]; uint8_t magic[4],extrabuf[8192],disablebits[32],*extraptr=0; FILE *fp; uint64_t val; uint16_t port; int32_t i,nonz,baseid,len,n,extralen = 0; uint64_t ccenables[256];
|
std::string name,addn; char *dirname,fname[512],arg0str[64],magicstr[9]; uint8_t magic[4],extrabuf[8192],disablebits[32],*extraptr=0; FILE *fp; uint64_t val; uint16_t port; int32_t i,nonz=0,baseid,len,n,extralen = 0; uint64_t ccenables[256];
|
||||||
IS_KOMODO_NOTARY = GetBoolArg("-notary", false);
|
IS_KOMODO_NOTARY = GetBoolArg("-notary", false);
|
||||||
memset(ccenables,0,sizeof(ccenables));
|
memset(ccenables,0,sizeof(ccenables));
|
||||||
memset(disablebits,0,sizeof(disablebits));
|
memset(disablebits,0,sizeof(disablebits));
|
||||||
|
|||||||
@@ -3274,7 +3274,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
|||||||
if (!ReceivedBlockTransactions(block, state, pindex, blockPos))
|
if (!ReceivedBlockTransactions(block, state, pindex, blockPos))
|
||||||
return error("AcceptBlock(): ReceivedBlockTransactions failed");
|
return error("AcceptBlock(): ReceivedBlockTransactions failed");
|
||||||
setDirtyFileInfo.insert(blockPos.nFile);
|
setDirtyFileInfo.insert(blockPos.nFile);
|
||||||
//fprintf(stderr,"added ht.%d copy of tmpfile to %d.%d\n",pindex->GetHeight(),blockPos.nFile,blockPos.nPos);
|
fprintf(stderr,"added ht.%d copy of tmpfile to %d.%d\n",pindex->GetHeight(),blockPos.nFile,blockPos.nPos);
|
||||||
}
|
}
|
||||||
// verify that the view's current state corresponds to the previous block
|
// verify that the view's current state corresponds to the previous block
|
||||||
uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash();
|
uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash();
|
||||||
@@ -5206,20 +5206,22 @@ bool AcceptBlock(int32_t *futureblockp,CBlock& block, CValidationState& state, C
|
|||||||
}
|
}
|
||||||
|
|
||||||
int nHeight = pindex->GetHeight();
|
int nHeight = pindex->GetHeight();
|
||||||
|
int32_t usetmp = 0;
|
||||||
// Write block to history file
|
// Write block to history file
|
||||||
try {
|
try {
|
||||||
unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION);
|
unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION);
|
||||||
CDiskBlockPos blockPos;
|
CDiskBlockPos blockPos;
|
||||||
if (dbp != NULL)
|
if (dbp != NULL)
|
||||||
blockPos = *dbp;
|
blockPos = *dbp;
|
||||||
if (!FindBlockPos(1,state, blockPos, nBlockSize+8, nHeight, block.GetBlockTime(), dbp != NULL))
|
if (!FindBlockPos(usetmp,state, blockPos, nBlockSize+8, nHeight, block.GetBlockTime(), dbp != NULL))
|
||||||
return error("AcceptBlock(): FindBlockPos failed");
|
return error("AcceptBlock(): FindBlockPos failed");
|
||||||
if (dbp == NULL)
|
if (dbp == NULL)
|
||||||
if (!WriteBlockToDisk(block, blockPos, chainparams.MessageStart()))
|
if (!WriteBlockToDisk(block, blockPos, chainparams.MessageStart()))
|
||||||
AbortNode(state, "Failed to write block");
|
AbortNode(state, "Failed to write block");
|
||||||
if (!ReceivedBlockTransactions(block, state, pindex, blockPos))
|
if (!ReceivedBlockTransactions(block, state, pindex, blockPos))
|
||||||
return error("AcceptBlock(): ReceivedBlockTransactions failed");
|
return error("AcceptBlock(): ReceivedBlockTransactions failed");
|
||||||
pindex->nStatus |= BLOCK_IN_TMPFILE;
|
if ( usetmp != 0 )
|
||||||
|
pindex->nStatus |= BLOCK_IN_TMPFILE;
|
||||||
} catch (const std::runtime_error& e) {
|
} catch (const std::runtime_error& e) {
|
||||||
return AbortNode(state, std::string("System error: ") + e.what());
|
return AbortNode(state, std::string("System error: ") + e.what());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -686,7 +686,7 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
|
|||||||
pindexNew->nTx = diskindex.nTx;
|
pindexNew->nTx = diskindex.nTx;
|
||||||
pindexNew->nSproutValue = diskindex.nSproutValue;
|
pindexNew->nSproutValue = diskindex.nSproutValue;
|
||||||
pindexNew->nSaplingValue = diskindex.nSaplingValue;
|
pindexNew->nSaplingValue = diskindex.nSaplingValue;
|
||||||
|
//fprintf(stderr,"loadguts ht.%d\n",pindexNew->GetHeight());
|
||||||
// Consistency checks
|
// Consistency checks
|
||||||
auto header = pindexNew->GetBlockHeader();
|
auto header = pindexNew->GetBlockHeader();
|
||||||
if (header.GetHash() != pindexNew->GetBlockHash())
|
if (header.GetHash() != pindexNew->GetBlockHash())
|
||||||
|
|||||||
Reference in New Issue
Block a user