]> Git Repo - VerusCoin.git/commitdiff
Merge branch 'dev' into jl777
authorjl777 <[email protected]>
Tue, 17 Apr 2018 20:28:32 +0000 (23:28 +0300)
committerGitHub <[email protected]>
Tue, 17 Apr 2018 20:28:32 +0000 (23:28 +0300)
1  2 
src/Makefile.am
src/komodo.h
src/miner.cpp

diff --cc src/Makefile.am
index f60f60a7c0f2eec11db4ecaa8514a64968db8605,5166a61034bb5ff72a5a61b06352b2b025b3c220..a1232968da6514a9e59d6c38a620a9d1017696e4
@@@ -528,8 -527,8 +528,8 @@@ wallet_utility_LDADD = 
        $(CRYPTO_LIBS) \
        $(LIBZCASH) \
        $(LIBSNARK) \
-     $(LIBZCASH_LIBS)\
-       $(LIBCRYPTOCONDITIONS)
+       $(LIBZCASH_LIBS)\
 -      $(LIBCRYPTOCONDITIONS)
++  $(LIBCRYPTOCONDITIONS)
  endif
  
  # zcash-tx binary #
diff --cc src/komodo.h
index 1b557d08b848ff095a56610721b02c5e33f5b0f9,829d64ec21c5963987b87817afadaa91f5c44aed..3bde3e02941cca800c68ce7159d49425c2742454
@@@ -679,55 -612,41 +679,55 @@@ int32_t komodo_voutupdate(int32_t *isra
                      }
                      else
                      {
-                         komodo_rwccdata(ASSETCHAINS_SYMBOL,1,&ccdata,&MoMoMdata);
 -                        //printf("VALID %s MoM.%s [%d]\n",ASSETCHAINS_SYMBOL,sp->MoM.ToString().c_str(),sp->MoMdepth);
++                        //komodo_rwccdata(ASSETCHAINS_SYMBOL,1,&ccdata,&MoMoMdata);
 +                        //printf("[%s] matched.%d VALID (%s) MoM.%s [%d]\n",ASSETCHAINS_SYMBOL,matched,ccdata.symbol,MoM.ToString().c_str(),MoMdepth);
                      }
 +                    if ( MoMoMdata.pairs != 0 )
 +                        free(MoMoMdata.pairs);
 +                    memset(&ccdata,0,sizeof(ccdata));
 +                    memset(&MoMoMdata,0,sizeof(MoMoMdata));
                  }
-                 else if ( ASSETCHAINS_SYMBOL[0] == 0 && matched != 0 && notarized != 0 && validated != 0 )
-                     komodo_rwccdata((char *)"KMD",1,&ccdata,0);
 -                komodo_stateupdate(height,0,0,0,zero,0,0,0,0,0,0,0,0,0,0,sp->MoM,sp->MoMdepth);
 -                len += nameoffset;
 -                if ( ASSETCHAINS_SYMBOL[0] != 0 )
 -                    printf("[%s] ht.%d NOTARIZED.%d %s.%s %sTXID.%s lens.(%d %d) MoM.%s %d\n",ASSETCHAINS_SYMBOL,height,*notarizedheightp,ASSETCHAINS_SYMBOL[0]==0?"KMD":ASSETCHAINS_SYMBOL,srchash.ToString().c_str(),ASSETCHAINS_SYMBOL[0]==0?"BTC":"KMD",desttxid.ToString().c_str(),opretlen,len,sp->MoM.ToString().c_str(),sp->MoMdepth);
 -                if ( ASSETCHAINS_SYMBOL[0] == 0 )
++                //else if ( ASSETCHAINS_SYMBOL[0] == 0 && matched != 0 && notarized != 0 && validated != 0 )
++                //    komodo_rwccdata((char *)"KMD",1,&ccdata,0);
 +                if ( matched != 0 && *notarizedheightp > sp->NOTARIZED_HEIGHT && *notarizedheightp < height )
                  {
 -                    if ( signedfp == 0 )
 -                    {
 -                        char fname[512];
 -                        komodo_statefname(fname,ASSETCHAINS_SYMBOL,(char *)"signedmasks");
 -                        if ( (signedfp= fopen(fname,"rb+")) == 0 )
 -                            signedfp = fopen(fname,"wb");
 -                        else fseek(signedfp,0,SEEK_END);
 -                    }
 -                    if ( signedfp != 0 )
 -                    {
 -                        fwrite(&height,1,sizeof(height),signedfp);
 -                        fwrite(&signedmask,1,sizeof(signedmask),signedfp);
 -                        fflush(signedfp);
 -                    }
 -                    if ( opretlen > len && scriptbuf[len] == 'A' )
 +                    sp->NOTARIZED_HEIGHT = *notarizedheightp;
 +                    sp->NOTARIZED_HASH = srchash;
 +                    sp->NOTARIZED_DESTTXID = desttxid;
 +                    sp->MoM = MoM;
 +                    sp->MoMdepth = MoMdepth;
 +                    komodo_stateupdate(height,0,0,0,zero,0,0,0,0,0,0,0,0,0,0,sp->MoM,sp->MoMdepth);
 +                    if ( ASSETCHAINS_SYMBOL[0] != 0 )
 +                        printf("[%s] ht.%d NOTARIZED.%d %s.%s %sTXID.%s lens.(%d %d) MoM.%s %d\n",ASSETCHAINS_SYMBOL,height,*notarizedheightp,ASSETCHAINS_SYMBOL[0]==0?"KMD":ASSETCHAINS_SYMBOL,srchash.ToString().c_str(),ASSETCHAINS_SYMBOL[0]==0?"BTC":"KMD",desttxid.ToString().c_str(),opretlen,len,sp->MoM.ToString().c_str(),sp->MoMdepth);
 +                    if ( ASSETCHAINS_SYMBOL[0] == 0 )
                      {
 -                        //for (i=0; i<opretlen-len; i++)
 -                        //    printf("%02x",scriptbuf[len+i]);
 -                        //printf(" Found extradata.[%d] %d - %d\n",opretlen-len,opretlen,len);
 -                        komodo_stateupdate(height,0,0,0,txhash,0,0,0,0,0,0,value,&scriptbuf[len],opretlen-len+4+3+(scriptbuf[1] == 0x4d),j,zero,0);
 +                        if ( signedfp == 0 )
 +                        {
 +                            char fname[512];
 +                            komodo_statefname(fname,ASSETCHAINS_SYMBOL,(char *)"signedmasks");
 +                            if ( (signedfp= fopen(fname,"rb+")) == 0 )
 +                                signedfp = fopen(fname,"wb");
 +                            else fseek(signedfp,0,SEEK_END);
 +                        }
 +                        if ( signedfp != 0 )
 +                        {
 +                            fwrite(&height,1,sizeof(height),signedfp);
 +                            fwrite(&signedmask,1,sizeof(signedmask),signedfp);
 +                            fflush(signedfp);
 +                        }
 +                        if ( opretlen > len && scriptbuf[len] == 'A' )
 +                        {
 +                            //for (i=0; i<opretlen-len; i++)
 +                            //    printf("%02x",scriptbuf[len+i]);
 +                            //printf(" Found extradata.[%d] %d - %d\n",opretlen-len,opretlen,len);
 +                            komodo_stateupdate(height,0,0,0,txhash,0,0,0,0,0,0,value,&scriptbuf[len],opretlen-len+4+3+(scriptbuf[1] == 0x4d),j,zero,0);
 +                        }
                      }
                  }
 -            } else if ( *notarizedheightp != sp->NOTARIZED_HEIGHT )
 -                printf("validated.%d notarized.%d %llx reject ht.%d NOTARIZED.%d prev.%d %s.%s DESTTXID.%s (%s) len.%d opretlen.%d\n",validated,notarized,(long long)signedmask,height,*notarizedheightp,sp->NOTARIZED_HEIGHT,ASSETCHAINS_SYMBOL[0]==0?"KMD":ASSETCHAINS_SYMBOL,srchash.ToString().c_str(),desttxid.ToString().c_str(),(char *)&scriptbuf[len],len,opretlen);
 +            } else if ( opretlen != 149 && height > 600000 && matched != 0 )
 +                printf("%s validated.%d notarized.%d %llx reject ht.%d NOTARIZED.%d prev.%d %s.%s DESTTXID.%s len.%d opretlen.%d\n",ccdata.symbol,validated,notarized,(long long)signedmask,height,*notarizedheightp,sp->NOTARIZED_HEIGHT,ASSETCHAINS_SYMBOL[0]==0?"KMD":ASSETCHAINS_SYMBOL,srchash.ToString().c_str(),desttxid.ToString().c_str(),len,opretlen);
          }
 -        else if ( i == 0 && j == 1 && opretlen == 149 )
 +        else if ( matched != 0 && i == 0 && j == 1 && opretlen == 149 )
          {
              if ( notaryid >= 0 && notaryid < 64 )
                  komodo_paxpricefeed(height,&scriptbuf[len],opretlen);
diff --cc src/miner.cpp
index ef67ad84c0d4cdd1d6a2cb3f91300555eeccdf2b,01817c759fc6cab07eb9af780e40ea7e0c8f5e61..790a848602debacc15ac752f5ad820de54cd4b16
@@@ -503,52 -503,52 +503,52 @@@ CBlockTemplate* CreateNewBlock(const CS
              return(0);
          }
      }
+     
      return pblocktemplate.release();
  }
 -
 + 
  /*
- #ifdef ENABLE_WALLET
- boost::optional<CScript> GetMinerScriptPubKey(CReserveKey& reservekey)
- #else
- boost::optional<CScript> GetMinerScriptPubKey()
- #endif
- {
-     CKeyID keyID;
-     CBitcoinAddress addr;
-     if (addr.SetString(GetArg("-mineraddress", ""))) {
-         addr.GetKeyID(keyID);
-     } else {
- #ifdef ENABLE_WALLET
-         CPubKey pubkey;
-         if (!reservekey.GetReservedKey(pubkey)) {
-             return boost::optional<CScript>();
-         }
-         keyID = pubkey.GetID();
- #else
-         return boost::optional<CScript>();
- #endif
-     }
-     CScript scriptPubKey = CScript() << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG;
-     return scriptPubKey;
- }
- #ifdef ENABLE_WALLET
- CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey)
- {
-     boost::optional<CScript> scriptPubKey = GetMinerScriptPubKey(reservekey);
- #else
- CBlockTemplate* CreateNewBlockWithKey()
- {
-     boost::optional<CScript> scriptPubKey = GetMinerScriptPubKey();
- #endif
-     if (!scriptPubKey) {
-         return NULL;
-     }
-     return CreateNewBlock(*scriptPubKey);
- }*/
 #ifdef ENABLE_WALLET
 boost::optional<CScript> GetMinerScriptPubKey(CReserveKey& reservekey)
 #else
 boost::optional<CScript> GetMinerScriptPubKey()
 #endif
 {
+  CKeyID keyID;
+  CBitcoinAddress addr;
+  if (addr.SetString(GetArg("-mineraddress", ""))) {
+  addr.GetKeyID(keyID);
+  } else {
 #ifdef ENABLE_WALLET
+  CPubKey pubkey;
+  if (!reservekey.GetReservedKey(pubkey)) {
+  return boost::optional<CScript>();
+  }
+  keyID = pubkey.GetID();
 #else
+  return boost::optional<CScript>();
 #endif
+  }
+  
+  CScript scriptPubKey = CScript() << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG;
+  return scriptPubKey;
 }
+  
 #ifdef ENABLE_WALLET
 CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey)
 {
+  boost::optional<CScript> scriptPubKey = GetMinerScriptPubKey(reservekey);
 #else
 CBlockTemplate* CreateNewBlockWithKey()
 {
+  boost::optional<CScript> scriptPubKey = GetMinerScriptPubKey();
 #endif
+  
+  if (!scriptPubKey) {
+  return NULL;
+  }
+  return CreateNewBlock(*scriptPubKey);
 }*/
  
  //////////////////////////////////////////////////////////////////////////////
  //
This page took 0.039918 seconds and 4 git commands to generate.