diff --git a/src/cc/eval.h b/src/cc/eval.h index 676fd0a73..e4c6a467d 100644 --- a/src/cc/eval.h +++ b/src/cc/eval.h @@ -144,7 +144,7 @@ public: inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { bool IsBack = IsBackNotarisation; - if (2 == IsBackNotarisation) IsBack = AutoIsBackNotarisation(s, ser_action); + if (2 == IsBackNotarisation) IsBack = DetectBackNotarisation(s, ser_action); READWRITE(blockHash); READWRITE(height); @@ -178,16 +178,18 @@ public: } template - bool AutoIsBackNotarisation(Stream& s, CSerActionUnserialize act) + bool DetectBackNotarisation(Stream& s, CSerActionUnserialize act) { if (ASSETCHAINS_SYMBOL[0]) return 1; - if (s.size() >= 72 && strcmp("BTC", &s[68]) == 0) return 1; - if (s.size() >= 72 && strcmp("KMD", &s[68]) == 0) return 1; + if (s.size() >= 72) { + if (strcmp("BTC", &s[68]) == 0) return 1; + if (strcmp("KMD", &s[68]) == 0) return 1; + } return 0; } template - bool AutoIsBackNotarisation(Stream& s, CSerActionSerialize act) + bool DetectBackNotarisation(Stream& s, CSerActionSerialize act) { return !txHash.IsNull(); } diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 2174a8d80..f88faf268 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1265,6 +1265,8 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_ return(isPoS); } +bool KOMODO_TEST_ASSETCHAIN_SKIP_POW = 0; + int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height) { uint256 hash; arith_uint256 bnTarget,bhash; bool fNegative,fOverflow; uint8_t *script,pubkey33[33],pubkeys[64][33]; int32_t i,possible,PoSperc,is_PoSblock=0,n,failed = 0,notaryid = -1; int64_t checktoshis,value; CBlockIndex *pprev; @@ -1304,6 +1306,7 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height) } else if ( possible == 0 || ASSETCHAINS_SYMBOL[0] != 0 ) { + if (KOMODO_TEST_ASSETCHAIN_SKIP_POW) return(0); fprintf(stderr,"pow violation and no chance it is notary ht.%d %s\n",height,hash.ToString().c_str()); return(-1); } diff --git a/src/test-komodo/test_crosschain.cpp b/src/test-komodo/test_crosschain.cpp index 356a7ab6c..9d24b4d1d 100644 --- a/src/test-komodo/test_crosschain.cpp +++ b/src/test-komodo/test_crosschain.cpp @@ -28,6 +28,7 @@ extern uint256 komodo_calcMoM(int32_t height,int32_t MoMdepth); +extern bool KOMODO_TEST_ASSETCHAIN_SKIP_POW; /* @@ -48,6 +49,7 @@ public: protected: static void SetUpTestCase() { } virtual void SetUp() { + KOMODO_TEST_ASSETCHAIN_SKIP_POW = 1; ASSETCHAINS_CC = 1; EVAL_TEST = this; }