@@ -71,6 +71,7 @@ cp ~/.zcash-params/testnet3/z9* ~/.zcash-params
|
|||||||
|
|
||||||
./zcutil/build.sh -j8 # -j8 uses 8 threads
|
./zcutil/build.sh -j8 # -j8 uses 8 threads
|
||||||
|
|
||||||
|
Once things are setup, you can build komodod with make from komodo/src directory. Also the error: configure: error: libsnark include directory not found, might appear and it looks like it can be ignored.
|
||||||
|
|
||||||
Create ~/.komodo/komodo.conf:
|
Create ~/.komodo/komodo.conf:
|
||||||
|
|
||||||
@@ -85,7 +86,7 @@ addnode="78.47.196.146"
|
|||||||
|
|
||||||
Start mining:
|
Start mining:
|
||||||
|
|
||||||
komodo/src/komodod -gen=1 -genproclimit=1
|
komodo/src/komodod -gen=1 -genproclimit=1 -addnode="78.47.196.146"
|
||||||
|
|
||||||
komodo/src/komodo-cli getinfo
|
komodo/src/komodo-cli getinfo
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ int32_t komodo_checkmsg(void *bitcoinpeer,uint8_t *data,int32_t datalen)
|
|||||||
int32_t komodo_blockcheck(void *block)
|
int32_t komodo_blockcheck(void *block)
|
||||||
{
|
{
|
||||||
//fprintf(stderr,"check block %p\n",block);
|
//fprintf(stderr,"check block %p\n",block);
|
||||||
return(-1);
|
// 1 -> valid notary block
|
||||||
|
// -1 -> invalid, ie, prior to notarized block
|
||||||
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
11
src/main.cpp
11
src/main.cpp
@@ -1334,6 +1334,7 @@ bool WriteBlockToDisk(CBlock& block, CDiskBlockPos& pos, const CMessageHeader::M
|
|||||||
|
|
||||||
bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos)
|
bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos)
|
||||||
{
|
{
|
||||||
|
int32_t retval;
|
||||||
block.SetNull();
|
block.SetNull();
|
||||||
|
|
||||||
// Open history file to read
|
// Open history file to read
|
||||||
@@ -1350,12 +1351,14 @@ bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check the header
|
// Check the header
|
||||||
if ( komodo_blockcheck((void *)&block) < 0 )
|
if ( (retval= komodo_blockcheck((void *)&block)) == 0 )
|
||||||
{
|
{
|
||||||
if (!(CheckEquihashSolution(&block, Params()) &&
|
if (!(CheckEquihashSolution(&block, Params()) &&
|
||||||
CheckProofOfWork(block.GetHash(), block.nBits, Params().GetConsensus())))
|
CheckProofOfWork(block.GetHash(), block.nBits, Params().GetConsensus())))
|
||||||
return error("ReadBlockFromDisk: Errors in block header at %s", pos.ToString());
|
return error("ReadBlockFromDisk: Errors in block header at %s", pos.ToString());
|
||||||
}
|
}
|
||||||
|
else if ( retval < 0 )
|
||||||
|
return(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2942,7 +2945,8 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne
|
|||||||
|
|
||||||
bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW)
|
bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW)
|
||||||
{
|
{
|
||||||
if ( komodo_blockcheck((void *)&block) < 0 )
|
int32_t retval;
|
||||||
|
if ( (retval= komodo_blockcheck((void *)&block)) == 0 )
|
||||||
{
|
{
|
||||||
// Check Equihash solution is valid
|
// Check Equihash solution is valid
|
||||||
if (fCheckPOW && !CheckEquihashSolution(&block, Params()))
|
if (fCheckPOW && !CheckEquihashSolution(&block, Params()))
|
||||||
@@ -2954,6 +2958,9 @@ bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool f
|
|||||||
return state.DoS(50, error("CheckBlockHeader(): proof of work failed"),
|
return state.DoS(50, error("CheckBlockHeader(): proof of work failed"),
|
||||||
REJECT_INVALID, "high-hash");
|
REJECT_INVALID, "high-hash");
|
||||||
}
|
}
|
||||||
|
else if ( retval < 0 ) // komodo rejects block, ie. prior to notarized blockhash
|
||||||
|
return(false);
|
||||||
|
|
||||||
// Check timestamp
|
// Check timestamp
|
||||||
if (block.GetBlockTime() > GetAdjustedTime() + 600)
|
if (block.GetBlockTime() > GetAdjustedTime() + 600)
|
||||||
return state.Invalid(error("CheckBlockHeader(): block timestamp too far in the future"),
|
return state.Invalid(error("CheckBlockHeader(): block timestamp too far in the future"),
|
||||||
|
|||||||
Reference in New Issue
Block a user