test
This commit is contained in:
@@ -562,6 +562,7 @@ void komodo_index2pubkey33(uint8_t *pubkey33,CBlockIndex *pindex,int32_t height)
|
|||||||
memset(pubkey33,0,33);
|
memset(pubkey33,0,33);
|
||||||
if ( pindex != 0 )
|
if ( pindex != 0 )
|
||||||
{
|
{
|
||||||
|
printf("call readblock\n");
|
||||||
if ( ReadBlockFromDisk(block,(const CBlockIndex *)pindex) != 0 )
|
if ( ReadBlockFromDisk(block,(const CBlockIndex *)pindex) != 0 )
|
||||||
{
|
{
|
||||||
printf("from index2pubkey33\n");
|
printf("from index2pubkey33\n");
|
||||||
|
|||||||
@@ -1341,13 +1341,17 @@ bool ReadBlockFromDisk(int32_t height,CBlock& block, const CDiskBlockPos& pos)
|
|||||||
// Open history file to read
|
// Open history file to read
|
||||||
CAutoFile filein(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION);
|
CAutoFile filein(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION);
|
||||||
if (filein.IsNull())
|
if (filein.IsNull())
|
||||||
|
{
|
||||||
|
fprintf(stderr,"readblockfromdisk err A\n");
|
||||||
return error("ReadBlockFromDisk: OpenBlockFile failed for %s", pos.ToString());
|
return error("ReadBlockFromDisk: OpenBlockFile failed for %s", pos.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
// Read block
|
// Read block
|
||||||
try {
|
try {
|
||||||
filein >> block;
|
filein >> block;
|
||||||
}
|
}
|
||||||
catch (const std::exception& e) {
|
catch (const std::exception& e) {
|
||||||
|
fprintf(stderr,"readblockfromdisk err B\n");
|
||||||
return error("%s: Deserialize or I/O error - %s at %s", __func__, e.what(), pos.ToString());
|
return error("%s: Deserialize or I/O error - %s at %s", __func__, e.what(), pos.ToString());
|
||||||
}
|
}
|
||||||
// Check the header
|
// Check the header
|
||||||
@@ -3151,6 +3155,7 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc
|
|||||||
return false;
|
return false;
|
||||||
if (pindex == NULL)
|
if (pindex == NULL)
|
||||||
pindex = AddToBlockIndex(block);
|
pindex = AddToBlockIndex(block);
|
||||||
|
printf("from AcceptBlock\n");
|
||||||
if (!CheckBlockHeader(pindex->nHeight,pindex, block, state))
|
if (!CheckBlockHeader(pindex->nHeight,pindex, block, state))
|
||||||
return false;
|
return false;
|
||||||
if (ppindex)
|
if (ppindex)
|
||||||
@@ -3164,7 +3169,7 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex,
|
|||||||
AssertLockHeld(cs_main);
|
AssertLockHeld(cs_main);
|
||||||
|
|
||||||
CBlockIndex *&pindex = *ppindex;
|
CBlockIndex *&pindex = *ppindex;
|
||||||
|
printf("from acceptblock\n");
|
||||||
if (!AcceptBlockHeader(block, state, &pindex))
|
if (!AcceptBlockHeader(block, state, &pindex))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -3238,6 +3243,7 @@ static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart, unsigned
|
|||||||
bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, bool fForceProcessing, CDiskBlockPos *dbp)
|
bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, bool fForceProcessing, CDiskBlockPos *dbp)
|
||||||
{
|
{
|
||||||
// Preliminary checks
|
// Preliminary checks
|
||||||
|
printf("ProcessNewBlock\n");
|
||||||
bool checked = CheckBlock(komodo_block2height(pblock),0,*pblock, state);
|
bool checked = CheckBlock(komodo_block2height(pblock),0,*pblock, state);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user