From 2934460ce3fbd90b6e8a2bb63c47c55efdc738e5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 17:41:16 +0300 Subject: [PATCH 01/28] Test --- src/komodo_bitcoind.h | 8 ++++---- src/komodo_gateway.h | 4 ++-- src/rpcblockchain.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 7b609ec8f..cc8ebe3d3 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -476,7 +476,7 @@ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t return(retval); } -uint256 komodo_getblockhash(int32_t height) +/*uint256 komodo_getblockhash(int32_t height) { uint256 hash; char params[128],*hexstr,*jsonstr; cJSON *result; int32_t i; uint8_t revbuf[32]; memset(&hash,0,sizeof(hash)); @@ -502,12 +502,12 @@ uint256 komodo_getblockhash(int32_t height) return(hash); } -uint256 _komodo_getblockhash(int32_t height); +uint256 _komodo_getblockhash(int32_t height);*/ uint64_t komodo_seed(int32_t height) { uint64_t seed = 0; - if ( 0 ) // problem during init time, seeds are needed for loading blockindex, so null seeds... + /*if ( 0 ) // problem during init time, seeds are needed for loading blockindex, so null seeds... { uint256 hash,zero; CBlockIndex *pindex; memset(&hash,0,sizeof(hash)); @@ -524,7 +524,7 @@ uint64_t komodo_seed(int32_t height) printf(" seed.%d\n",height); seed = arith_uint256(hash.GetHex()).GetLow64(); } - else + else*/ { seed = (height << 13) ^ (height << 2); seed <<= 21; diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 4c6bdcb23..5e13283e1 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1365,12 +1365,12 @@ void komodo_passport_iteration() if ( ASSETCHAINS_SYMBOL[0] == 0 ) { refid = 33; - limit = 1000000; + limit = 10000000; jumblr_iteration(); } else { - limit = 10000; + limit = 10000000; refid = komodo_baseid(ASSETCHAINS_SYMBOL)+1; // illegal base -> baseid.-1 -> 0 if ( refid == 0 ) { diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 448b73580..8088da58f 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -309,7 +309,7 @@ UniValue getblockhash(const UniValue& params, bool fHelp) return pblockindex->GetBlockHash().GetHex(); } -uint256 _komodo_getblockhash(int32_t nHeight) +/*uint256 _komodo_getblockhash(int32_t nHeight) { uint256 hash; LOCK(cs_main); @@ -323,7 +323,7 @@ uint256 _komodo_getblockhash(int32_t nHeight) printf(" blockhash.%d\n",nHeight); } else memset(&hash,0,sizeof(hash)); return(hash); -} +}*/ UniValue getblockheader(const UniValue& params, bool fHelp) { From 5201bb517217d1a6bec4cf9217ec9e8559eeb767 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 18:01:45 +0300 Subject: [PATCH 02/28] Test --- src/komodo_bitcoind.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index cc8ebe3d3..8c19d2946 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -431,7 +431,24 @@ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t if ( strcmp(dest,"KMD") == 0 ) { if ( KMDUSERPASS[0] != 0 ) - jsonstr = komodo_issuemethod(KMDUSERPASS,(char *)"getrawtransaction",params,7771); + { + if ( ASSETCHAINS_SYMBOL[0] != 0 ) + jsonstr = komodo_issuemethod(KMDUSERPASS,(char *)"getrawtransaction",params,7771); + else + { + CTransaction tx; uint256 hashBlock; int32_t numvouts,len; uint8_t *ptr; + if ( GetTransaction(txid,tx,hashBlock,true) == 0 ) + return(-1); + if ( (numvouts= tx.vout.size()) > 0 ) + { + ptr = (uint8_t *)tx.vout[numvouts - 1].scriptPubKey.data(); + len = tx.vout[numvouts - 1].scriptPubKey.size(); + retval = komodo_verifynotarizedscript(height,ptr,len,NOTARIZED_HASH); + printf("direct verify ht.%d -> %d\n",height,retval); + return(retval); + } + } + } //else jsonstr = _dex_getrawtransaction(); else return(0); // need universal way to issue DEX* API, since notaries mine most blocks, this ok } From 19d98d6fbf3b8ae0b181d2ddd4973c990736d695 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 18:05:13 +0300 Subject: [PATCH 03/28] Test --- src/komodo_bitcoind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 8c19d2946..4e036f69a 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -437,7 +437,7 @@ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t else { CTransaction tx; uint256 hashBlock; int32_t numvouts,len; uint8_t *ptr; - if ( GetTransaction(txid,tx,hashBlock,true) == 0 ) + if ( GetTransaction(NOTARIZED_DESTTXID,tx,hashBlock,true) == 0 ) return(-1); if ( (numvouts= tx.vout.size()) > 0 ) { From 00603efa67355c7cfa8e5ae5d15bcd6e5c6e55ce Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 18:10:08 +0300 Subject: [PATCH 04/28] Test --- src/komodo_bitcoind.h | 14 -------------- src/komodo_gateway.h | 6 +++++- src/komodo_kv.h | 4 +++- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 4e036f69a..5be8da5e2 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -434,20 +434,6 @@ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t { if ( ASSETCHAINS_SYMBOL[0] != 0 ) jsonstr = komodo_issuemethod(KMDUSERPASS,(char *)"getrawtransaction",params,7771); - else - { - CTransaction tx; uint256 hashBlock; int32_t numvouts,len; uint8_t *ptr; - if ( GetTransaction(NOTARIZED_DESTTXID,tx,hashBlock,true) == 0 ) - return(-1); - if ( (numvouts= tx.vout.size()) > 0 ) - { - ptr = (uint8_t *)tx.vout[numvouts - 1].scriptPubKey.data(); - len = tx.vout[numvouts - 1].scriptPubKey.size(); - retval = komodo_verifynotarizedscript(height,ptr,len,NOTARIZED_HASH); - printf("direct verify ht.%d -> %d\n",height,retval); - return(retval); - } - } } //else jsonstr = _dex_getrawtransaction(); else return(0); // need universal way to issue DEX* API, since notaries mine most blocks, this ok diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 5e13283e1..06fe8cd1b 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1147,7 +1147,9 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 { if ( baseids[i] < 0 ) { - printf("%d of %d illegal baseid.%d\n",i,n,baseids[i]); + static uint32_t counter; + if ( counter++ < 3 ) + printf("%d of %d illegal baseid.%d, this can be ignored\n",i,n,baseids[i]); continue; } bitcoin_address(coinaddr,60,&rmd160s[i*20],20); @@ -1384,6 +1386,8 @@ void komodo_passport_iteration() return; }*/ starttime = (uint32_t)time(NULL); + if ( lasttime == 0 ) + limit = 10; if ( 0 && starttime == lasttime ) { usleep(1000); diff --git a/src/komodo_kv.h b/src/komodo_kv.h index e121a793e..d4f6dcca2 100644 --- a/src/komodo_kv.h +++ b/src/komodo_kv.h @@ -106,7 +106,9 @@ void komodo_kvupdate(uint8_t *opretbuf,int32_t opretlen,uint64_t value) key = &opretbuf[13]; if ( keylen+13 > opretlen ) { - printf("komodo_kvupdate: keylen.%d + 13 > opretlen.%d\n",keylen,opretlen); + static uint32_t counter; + if ( counter++ < 3 ) + printf("komodo_kvupdate: keylen.%d + 13 > opretlen.%d, this can be ignored\n",keylen,opretlen); return; } valueptr = &key[keylen]; From 7a36605c11ce31622d5c0495551c0ac5d23c3ac3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 18:15:24 +0300 Subject: [PATCH 05/28] Test --- src/komodo_events.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/komodo_events.h b/src/komodo_events.h index 110c1f757..6f4a3b6bd 100644 --- a/src/komodo_events.h +++ b/src/komodo_events.h @@ -46,6 +46,7 @@ void komodo_eventadd_notarized(struct komodo_state *sp,char *symbol,int32_t heig } else { + fprintf(stderr,"validated %s ht.%d notarized %d\n",ASSETCHAINS_SYMBOL,height,notarizedheight); memset(&N,0,sizeof(N)); N.blockhash = notarized_hash; N.desttxid = notarized_desttxid; From 3c9b7fbb468ecedb50922bda04a84956d86e05ef Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 18:16:41 +0300 Subject: [PATCH 06/28] Test --- src/komodo_events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_events.h b/src/komodo_events.h index 6f4a3b6bd..226f4fbde 100644 --- a/src/komodo_events.h +++ b/src/komodo_events.h @@ -46,7 +46,7 @@ void komodo_eventadd_notarized(struct komodo_state *sp,char *symbol,int32_t heig } else { - fprintf(stderr,"validated %s ht.%d notarized %d\n",ASSETCHAINS_SYMBOL,height,notarizedheight); + //fprintf(stderr,"validated %s ht.%d notarized %d\n",ASSETCHAINS_SYMBOL,height,notarizedheight); memset(&N,0,sizeof(N)); N.blockhash = notarized_hash; N.desttxid = notarized_desttxid; From 827756b6502f4504c3dacf250ed4498c01d63ddd Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 18:23:09 +0300 Subject: [PATCH 07/28] Test --- src/komodo_events.h | 2 +- src/komodo_gateway.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/komodo_events.h b/src/komodo_events.h index 226f4fbde..6f4a3b6bd 100644 --- a/src/komodo_events.h +++ b/src/komodo_events.h @@ -46,7 +46,7 @@ void komodo_eventadd_notarized(struct komodo_state *sp,char *symbol,int32_t heig } else { - //fprintf(stderr,"validated %s ht.%d notarized %d\n",ASSETCHAINS_SYMBOL,height,notarizedheight); + fprintf(stderr,"validated %s ht.%d notarized %d\n",ASSETCHAINS_SYMBOL,height,notarizedheight); memset(&N,0,sizeof(N)); N.blockhash = notarized_hash; N.desttxid = notarized_desttxid; diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 06fe8cd1b..225d1a927 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1353,7 +1353,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 void komodo_passport_iteration() { - static long lastpos[34]; static char userpass[33][1024]; static uint32_t lasttime; + static long lastpos[34]; static char userpass[33][1024]; static uint32_t lasttime,callcounter; int32_t maxseconds = 10; FILE *fp; int32_t baseid,limit,n,ht,isrealtime,expired,refid,blocks,longest; struct komodo_state *sp,*refsp; char *retstr,fname[512],*base,symbol[16],dest[16]; uint32_t buf[3],starttime; cJSON *infoobj,*result; uint64_t RTmask = 0; //printf("PASSPORT.(%s)\n",ASSETCHAINS_SYMBOL); @@ -1386,8 +1386,8 @@ void komodo_passport_iteration() return; }*/ starttime = (uint32_t)time(NULL); - if ( lasttime == 0 ) - limit = 10; + if ( callcounter++ < 1 ) + limit = 10000; if ( 0 && starttime == lasttime ) { usleep(1000); From c2f1df5e0769f3a5ede01af701fd372bba496810 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 18:25:01 +0300 Subject: [PATCH 08/28] Test --- src/komodo_events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_events.h b/src/komodo_events.h index 6f4a3b6bd..226f4fbde 100644 --- a/src/komodo_events.h +++ b/src/komodo_events.h @@ -46,7 +46,7 @@ void komodo_eventadd_notarized(struct komodo_state *sp,char *symbol,int32_t heig } else { - fprintf(stderr,"validated %s ht.%d notarized %d\n",ASSETCHAINS_SYMBOL,height,notarizedheight); + //fprintf(stderr,"validated %s ht.%d notarized %d\n",ASSETCHAINS_SYMBOL,height,notarizedheight); memset(&N,0,sizeof(N)); N.blockhash = notarized_hash; N.desttxid = notarized_desttxid; From c452b1d712cd9dec6a7bc0b98e45bc7ce8cc2c39 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 18:28:12 +0300 Subject: [PATCH 09/28] Test --- src/komodo_events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_events.h b/src/komodo_events.h index 226f4fbde..0ee3aa1f3 100644 --- a/src/komodo_events.h +++ b/src/komodo_events.h @@ -42,7 +42,7 @@ void komodo_eventadd_notarized(struct komodo_state *sp,char *symbol,int32_t heig if ( komodo_verifynotarization(symbol,dest,height,notarizedheight,notarized_hash,notarized_desttxid) != 0 ) { if ( height > 50000 ) - printf("[%s] error validating notarization ht.%d notarized_height.%d\n",ASSETCHAINS_SYMBOL,height,notarizedheight); + printf("[%s] error validating notarization ht.%d notarized_height.%d, if on a pruned %s node this can be ignored\n",ASSETCHAINS_SYMBOL,height,notarizedheight,dest); } else { From bd901dd742fc0dc03cb0a4f6dc147b88609423be Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 18:58:40 +0300 Subject: [PATCH 10/28] Reduce print --- src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 1e9be1a06..b354c1430 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4977,7 +4977,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, pfrom->PushMessage("headers", vHeaders); } else if ( NOTARY_PUBKEY33[0] != 0 ) - fprintf(stderr,"you can ignore redundant getheaders from peer.%d %d prev.%d\n",(int32_t)pfrom->id,(int32_t)(pindex ? pindex->nHeight : -1),pfrom->lasthdrsreq); + { + static uint32_t counter; + if ( counter++ < 3 ) + fprintf(stderr,"you can ignore redundant getheaders from peer.%d %d prev.%d\n",(int32_t)pfrom->id,(int32_t)(pindex ? pindex->nHeight : -1),pfrom->lasthdrsreq); + } } From a08b1ae8e84dd63ef08797a34c92b38606028745 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Oct 2017 21:51:32 +0300 Subject: [PATCH 11/28] README --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 2bbd8a743..6c927185c 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,25 @@ sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev li Komodo ------ +We have a release process that goes through several stages before it reaches master. This allows the most conservative users just use the master branch, which is only updated after the other branches have signed off on a release. + +99% of the activity is in the dev branch, this is where I am testing each change one by one and there are literally thousands of updates. Only use this branch if you really want to be on the bleeding edge. I try to keep things stable, but there are times where necessarily there are bugs in the dev branch, since I am actively developing and debugging here. A good rule is to wait for at least 4 hours from the last update before using the dev branch (unless you know what you are doing) + +After things look good in the dev branch, it is propagated to the beta branch, this is the version the notary nodes use. They are knowledegable command line server guys and so they have a keen eye for anything that wasnt caught during the dev cycle. + +After the notary nodes verify things are working and the latest release is deemed stable, it is propagated to the dPoW branch. From here an automated Jenkins process builds it for all OS, and since the notary nodes are all unix, it is possible for some issues to be caught at this stage. The dPoW branch is what goes into the GUI installers. + +After the GUI are updated and released and it is verified that no significant support issues were created, the master branch is finally updated. + +Master branch: exchanges and users that build from the repo without changing branches +dPoW branch: autobuild into GUI installers, unix, osx, windows +beta branch: notary nodes, command line unix +dev branch: bleeding edge, possibly wont even compile, multiple updates per hour ``` git clone https://github.com/jl777/komodo cd komodo +#you might want to: git checkout ; git pull ./zcutil/fetch-params.sh # -j8 uses 8 threads - replace 8 with number of threads you want to use ./zcutil/build.sh -j8 From 42c6ba054c77d5821001b328dd5b6a3fc5751004 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 13:17:06 +0300 Subject: [PATCH 12/28] New interest --- src/komodo_interest.h | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 6355173d8..4d3350545 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -64,9 +64,30 @@ uint64_t komodo_moneysupply(int32_t height) else return(COIN * 100000000 + (height-1) * 3 + komodo_earned_interest(height,-1)); } +uint64_t _komodo_interestnew(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime) +{ + int32_t minutes; uint64_t interest = 0; + if ( (minutes= (tiptime - nLockTime) / 60) >= 60 ) + { + if ( minutes > 365 * 24 * 60 ) + minutes = 365 * 24 * 60; + minutes -= 59; + interest = ((nValue / 10512000) * minutes); + } + return(interest); +} + +uint64_t komodo_interestnew(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime) +{ + uint64_t interest = 0; + if ( komodo_moneysupply(txheight) < MAX_MONEY && nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= 10*COIN ) + interest = _komodo_interestnew(nValue,nLockTime,tiptime); + return(interest); +} + uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime) { - int32_t minutes,exception; uint64_t numerator,denominator,interest = 0; uint32_t activation; + int32_t minutes,exception; uint64_t interestnew,numerator,denominator,interest = 0; uint32_t activation; activation = 1491350400; // 1491350400 5th April if ( ASSETCHAINS_SYMBOL[0] != 0 ) return(0); @@ -111,11 +132,15 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin interest = (numerator / denominator); else interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60); } - else + else if ( txheight < 1000000 ) { numerator = (nValue * KOMODO_INTEREST); interest = (numerator / denominator) / COIN; + interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); + //if ( interest != interestnew ) + printf("path0 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } + else interest = _komodo_interestnew(nValue,nLockTime,tiptime); } else { @@ -132,12 +157,16 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin interest = (numerator / denominator) / COIN; else interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)) / COIN; } - else + else if ( txheight < 1000000 ) { numerator = (nValue / 20); // assumes 5%! interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)); //fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes); + interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); + if ( interest != interestnew ) + printf("path1 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } + else interest = _komodo_interestnew(nValue,nLockTime,tiptime); } if ( 0 && numerator == (nValue * KOMODO_INTEREST) ) fprintf(stderr,"komodo_interest.%d %lld %.8f nLockTime.%u tiptime.%u minutes.%d interest %lld %.8f (%llu / %llu) prod.%llu\n",txheight,(long long)nValue,(double)nValue/COIN,nLockTime,tiptime,minutes,(long long)interest,(double)interest/COIN,(long long)numerator,(long long)denominator,(long long)(numerator * minutes)); From 50a979bc87a87588fb56350fd8573e5562b04ca0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 13:32:02 +0300 Subject: [PATCH 13/28] Test --- src/komodo_interest.h | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 4d3350545..c05445394 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -13,13 +13,15 @@ * * ******************************************************************************/ +#define dstr(x) ((double)(x) / SATOSHIDEN) + #define KOMODO_INTEREST ((uint64_t)(0.05 * COIN)) // 5% int64_t MAX_MONEY = 200000000 * 100000000LL; uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) { static uint64_t *interests; static int32_t maxheight; - uint64_t total; int32_t ind,incr = 100000; + uint64_t total; int32_t ind,incr = 10000; if ( height >= maxheight ) { if ( interests == 0 ) @@ -36,16 +38,20 @@ uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) } ind = (height << 1); if ( paidinterest < 0 ) // request + { return(interests[ind]); + } else { if ( interests[ind + 1] != paidinterest ) { + fprintf(stderr,"interests.%d %.8f %.8f vs paidinterest.%d\n",height,dstr(interests[ind]),dstr(interests[ind+1]),dstr(paidinterest)); interests[ind + 1] = paidinterest; - if ( height == 0 ) - interests[ind] = interests[ind + 1]; - else interests[ind] = interests[ind - 2] + interests[ind + 1]; - total = interests[ind]; + if ( height <= 1 ) + interests[ind] = 0; + else interests[ind] = interests[ind - 2] + interests[ind - 1]; + total = interests[ind] + paidinterest; + fprintf(stderr,"reset interests[height.%d to maxheight.%d] <- %.8f\n",height,maxheight,dstr(total)); for (++height; height Date: Tue, 10 Oct 2017 13:34:24 +0300 Subject: [PATCH 14/28] Test --- src/komodo_interest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index c05445394..454ed3587 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -45,7 +45,7 @@ uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) { if ( interests[ind + 1] != paidinterest ) { - fprintf(stderr,"interests.%d %.8f %.8f vs paidinterest.%d\n",height,dstr(interests[ind]),dstr(interests[ind+1]),dstr(paidinterest)); + fprintf(stderr,"interests.%d %.8f %.8f vs paidinterest %.8f\n",height,dstr(interests[ind]),dstr(interests[ind+1]),dstr(paidinterest)); interests[ind + 1] = paidinterest; if ( height <= 1 ) interests[ind] = 0; From 2f38e8886bd7c414acdcee15911059052d430133 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 13:36:03 +0300 Subject: [PATCH 15/28] Test --- src/komodo_interest.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 454ed3587..06641ed2c 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -13,6 +13,7 @@ * * ******************************************************************************/ +#define SATOSHIDEN ((uint64_t)100000000L) #define dstr(x) ((double)(x) / SATOSHIDEN) #define KOMODO_INTEREST ((uint64_t)(0.05 * COIN)) // 5% From 5dd58d6112d67be0f3c0305c033849bb2da4f041 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 13:49:50 +0300 Subject: [PATCH 16/28] Test --- src/komodo_interest.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 06641ed2c..a407aabd8 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -23,6 +23,7 @@ uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) { static uint64_t *interests; static int32_t maxheight; uint64_t total; int32_t ind,incr = 10000; + // need to make interests persistent before 2030 if ( height >= maxheight ) { if ( interests == 0 ) @@ -145,7 +146,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin numerator = (nValue * KOMODO_INTEREST); interest = (numerator / denominator) / COIN; interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); - if ( interest != interestnew ) + if ( interest < interestnew || interestnew < 0.9999*interest ) fprintf(stderr,"path0 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } else interest = _komodo_interestnew(nValue,nLockTime,tiptime); @@ -171,7 +172,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)); //fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes); interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); - if ( interest != interestnew ) + if ( interest < interestnew || interestnew < 0.9999*interest ) fprintf(stderr,"path1 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } else interest = _komodo_interestnew(nValue,nLockTime,tiptime); From 6da8d0d55eba534924c93919aee3b9ebc390e674 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 14:15:58 +0300 Subject: [PATCH 17/28] Test --- src/komodo_interest.h | 6 +++--- src/main.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index a407aabd8..27ab20be4 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -23,7 +23,7 @@ uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) { static uint64_t *interests; static int32_t maxheight; uint64_t total; int32_t ind,incr = 10000; - // need to make interests persistent before 2030 + // need to make interests persistent before 2030, or just hardfork interest/mining rewards disable after MAX_MONEY is exceeded if ( height >= maxheight ) { if ( interests == 0 ) @@ -45,7 +45,7 @@ uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) } else { - if ( interests[ind + 1] != paidinterest ) + if ( interests[ind + 1] != paidinterest ) // need to handle skips like at 80000 { fprintf(stderr,"interests.%d %.8f %.8f vs paidinterest %.8f\n",height,dstr(interests[ind]),dstr(interests[ind+1]),dstr(paidinterest)); interests[ind + 1] = paidinterest; @@ -68,7 +68,7 @@ uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) uint64_t komodo_moneysupply(int32_t height) { - if ( height <= 1 || ASSETCHAINS_SYMBOL[0] != 0 ) + if ( height <= 1 || ASSETCHAINS_SYMBOL[0] == 0 ) return(0); else return(COIN * 100000000 + (height-1) * 3 + komodo_earned_interest(height,-1)); } diff --git a/src/main.cpp b/src/main.cpp index b354c1430..8f028dbb7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2365,7 +2365,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin return false; control.Add(vChecks); } - komodo_earned_interest(pindex->nHeight,sum); + if ( ASSETCHAINS_SYMBOL[0] == 0 ) + komodo_earned_interest(pindex->nHeight,sum); CTxUndo undoDummy; if (i > 0) { blockundo.vtxundo.push_back(CTxUndo()); From 1f8581e154e1d5f1a58fafe720f9626a2a5b8b16 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 14:29:37 +0300 Subject: [PATCH 18/28] Test --- src/komodo_interest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 27ab20be4..a01d9adea 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -61,7 +61,7 @@ uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) interests[ind + 1] = 0; } } - else fprintf(stderr,"interests.%d %.8f %.8f\n",height,dstr(interests[ind]),dstr(interests[ind+1])); + //else fprintf(stderr,"interests.%d %.8f %.8f\n",height,dstr(interests[ind]),dstr(interests[ind+1])); } return(0); } From 319fa8be5567ca96f4f85bd9c53ff32a525992c1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 14:42:34 +0300 Subject: [PATCH 19/28] Test --- src/komodo_interest.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index a01d9adea..4292c6771 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -24,6 +24,7 @@ uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) static uint64_t *interests; static int32_t maxheight; uint64_t total; int32_t ind,incr = 10000; // need to make interests persistent before 2030, or just hardfork interest/mining rewards disable after MAX_MONEY is exceeded + return(0); if ( height >= maxheight ) { if ( interests == 0 ) @@ -47,13 +48,13 @@ uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) { if ( interests[ind + 1] != paidinterest ) // need to handle skips like at 80000 { - fprintf(stderr,"interests.%d %.8f %.8f vs paidinterest %.8f\n",height,dstr(interests[ind]),dstr(interests[ind+1]),dstr(paidinterest)); + //fprintf(stderr,"interests.%d %.8f %.8f vs paidinterest %.8f\n",height,dstr(interests[ind]),dstr(interests[ind+1]),dstr(paidinterest)); interests[ind + 1] = paidinterest; if ( height <= 1 ) interests[ind] = 0; else interests[ind] = interests[ind - 2] + interests[ind - 1]; total = interests[ind] + paidinterest; - fprintf(stderr,"reset interests[height.%d to maxheight.%d] <- %.8f\n",height,maxheight,dstr(total)); + //fprintf(stderr,"reset interests[height.%d to maxheight.%d] <- %.8f\n",height,maxheight,dstr(total)); for (++height; height Date: Tue, 10 Oct 2017 14:59:33 +0300 Subject: [PATCH 20/28] Test --- src/komodo_interest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 4292c6771..662087ae1 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -173,7 +173,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)); //fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes); interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); - if ( interest < interestnew || interestnew < 0.9999*interest ) + if ( interest < interestnew || (interestnew < 0.9999*interest && (interest-interestnow) > 10000) ) fprintf(stderr,"path1 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } else interest = _komodo_interestnew(nValue,nLockTime,tiptime); From 4a5b2da93bd43db1b9e31754aa485313a0e42e3c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 15:04:52 +0300 Subject: [PATCH 21/28] Test --- src/komodo_interest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 662087ae1..54791e48d 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -173,7 +173,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)); //fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes); interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); - if ( interest < interestnew || (interestnew < 0.9999*interest && (interest-interestnow) > 10000) ) + if ( interest < interestnew || (interestnew < 0.9999*interest && (interest-interestnew) > 10000) ) fprintf(stderr,"path1 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } else interest = _komodo_interestnew(nValue,nLockTime,tiptime); From 2ec7c24dc739c0ee2e57575fb11f637b1e93aa5a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 15:11:11 +0300 Subject: [PATCH 22/28] Test --- src/komodo.h | 3 ++- src/komodo_interest.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index e1e40448d..23ccb6338 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -547,7 +547,8 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) numvalid = bitweight(signedmask); if ( (((height < 90000 || (signedmask & 1) != 0) && numvalid >= KOMODO_MINRATIFY) || numvalid > (numnotaries/5)) ) { - printf("%s ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d <<<<<<<<<<< notarized\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts); + if ( height > 500000 ) + printf("%s ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d <<<<<<<<<<< notarized\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts); notarized = 1; } if ( NOTARY_PUBKEY33[0] != 0 && ASSETCHAINS_SYMBOL[0] == 0 ) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 54791e48d..508ae2fac 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -173,7 +173,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)); //fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes); interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); - if ( interest < interestnew || (interestnew < 0.9999*interest && (interest-interestnew) > 10000) ) + if ( interest < interestnew || (interestnew < 0.9999*interest && (interest-interestnew) > 50000) ) fprintf(stderr,"path1 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } else interest = _komodo_interestnew(nValue,nLockTime,tiptime); From fc28273bfe9a1c8f83604c67d404712c5ace6f3a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 15:20:08 +0300 Subject: [PATCH 23/28] Test --- src/komodo_interest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 508ae2fac..82581bb03 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -173,7 +173,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)); //fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes); interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); - if ( interest < interestnew || (interestnew < 0.9999*interest && (interest-interestnew) > 50000) ) + if ( interest < interestnew )//|| (interestnew < 0.9999*interest && (interest-interestnew) > 50000) ) fprintf(stderr,"path1 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } else interest = _komodo_interestnew(nValue,nLockTime,tiptime); From 6cfebd395ac5992ccc32de3f1b08b43b61f8b11c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 15:44:55 +0300 Subject: [PATCH 24/28] Test --- src/komodo_interest.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 82581bb03..930e2675a 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -140,14 +140,21 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin numerator = (nValue / 20); // assumes 5%! if ( txheight < 250000 ) interest = (numerator / denominator); - else interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60); + else if ( txheight < 1000000 ) + { + interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60); + interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); + //if ( interest < interestnew || interestnew < 0.9999*interest ) + fprintf(stderr,"path0 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); + } + else interest = _komodo_interestnew(nValue,nLockTime,tiptime); } else if ( txheight < 1000000 ) { numerator = (nValue * KOMODO_INTEREST); interest = (numerator / denominator) / COIN; interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); - //if ( interest < interestnew || interestnew < 0.9999*interest ) + if ( interest < interestnew ) fprintf(stderr,"path0 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } else interest = _komodo_interestnew(nValue,nLockTime,tiptime); From fb58b26e51b8225df77de20642c1f942b809e95f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 16:00:35 +0300 Subject: [PATCH 25/28] Test --- src/komodo_interest.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 930e2675a..1795a64bf 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -144,8 +144,8 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin { interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60); interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); - //if ( interest < interestnew || interestnew < 0.9999*interest ) - fprintf(stderr,"path0 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); + if ( interest < interestnew ) + printf("path0 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } else interest = _komodo_interestnew(nValue,nLockTime,tiptime); } @@ -155,7 +155,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin interest = (numerator / denominator) / COIN; interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); if ( interest < interestnew ) - fprintf(stderr,"path0 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); + printf("path0 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } else interest = _komodo_interestnew(nValue,nLockTime,tiptime); } @@ -181,7 +181,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin //fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes); interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); if ( interest < interestnew )//|| (interestnew < 0.9999*interest && (interest-interestnew) > 50000) ) - fprintf(stderr,"path1 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); + printf("path1 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } else interest = _komodo_interestnew(nValue,nLockTime,tiptime); } From 1625f62f58265e9aead7dbd168be516fdebab7ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 Oct 2017 23:51:01 +0300 Subject: [PATCH 26/28] More delay for assetchains.old --- src/assetchains.old | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assetchains.old b/src/assetchains.old index aba219688..e7584afcd 100755 --- a/src/assetchains.old +++ b/src/assetchains.old @@ -1,6 +1,6 @@ #!/bin/bash set -x -delay=10 +delay=60 source pubkey.txt echo $pubkey From 1248a49e4f2d540ce1b45139e841b67c109d572a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 01:54:15 +0300 Subject: [PATCH 27/28] Fix windows .conf locations --- src/komodo_utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 4f2fd726e..e330a66ac 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1580,8 +1580,8 @@ void komodo_args(char *argv0) while ( fname[strlen(fname)-1] != '\\' ) fname[strlen(fname)-1] = 0; if ( iter == 0 ) - strcat(fname,".komodo\\komodo.conf"); - else strcat(fname,".bitcoin\\bitcoin.conf"); + strcat(fname,"Komodo\\komodo.conf"); + else strcat(fname,"Bitcoin\\bitcoin.conf"); #else while ( fname[strlen(fname)-1] != '/' ) fname[strlen(fname)-1] = 0; From 9cb1ec9c6ee2a26dcb7ca3eadc551a084c6128a5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 15 Oct 2017 02:04:29 +0300 Subject: [PATCH 28/28] WIN32 -> _WIN32 --- src/bitcoind.cpp | 2 +- src/compat.h | 10 +++++----- src/init.cpp | 14 +++++++------- src/komodo_pax.h | 2 +- src/komodo_structs.h | 2 +- src/komodo_utils.h | 10 +++++----- src/metrics.cpp | 4 ++-- src/net.cpp | 16 ++++++++-------- src/net.h | 2 +- src/netbase.cpp | 18 +++++++++--------- src/netbase.h | 2 +- src/protocol.cpp | 2 +- src/random.cpp | 6 +++--- src/support/pagelocker.cpp | 6 +++--- src/test/alert_tests.cpp | 2 +- src/util.cpp | 30 +++++++++++++++--------------- src/util.h | 6 +++--- src/wallet/db.cpp | 2 +- 18 files changed, 68 insertions(+), 68 deletions(-) diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 26e9c8327..050305117 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -173,7 +173,7 @@ bool AppInit(int argc, char* argv[]) exit(1); } -#ifndef WIN32 +#ifndef _WIN32 fDaemon = GetBoolArg("-daemon", false); if (fDaemon) { diff --git a/src/compat.h b/src/compat.h index feaa544e2..27afc8b2a 100644 --- a/src/compat.h +++ b/src/compat.h @@ -10,7 +10,7 @@ #include "config/bitcoin-config.h" #endif -#ifdef WIN32 +#ifdef _WIN32 #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif @@ -46,7 +46,7 @@ #include #endif -#ifdef WIN32 +#ifdef _WIN32 #define MSG_DONTWAIT 0 #else typedef u_int SOCKET; @@ -64,7 +64,7 @@ typedef u_int SOCKET; #define SOCKET_ERROR -1 #endif -#ifdef WIN32 +#ifdef _WIN32 #ifndef S_IRUSR #define S_IRUSR 0400 #define S_IWUSR 0200 @@ -78,7 +78,7 @@ typedef u_int SOCKET; #define MSG_NOSIGNAL 0 #endif -#ifndef WIN32 +#ifndef _WIN32 // PRIO_MAX is not defined on Solaris #ifndef PRIO_MAX #define PRIO_MAX 20 @@ -94,7 +94,7 @@ size_t strnlen( const char *start, size_t max_len); #endif // HAVE_DECL_STRNLEN bool static inline IsSelectableSocket(SOCKET s) { -#ifdef WIN32 +#ifdef _WIN32 return true; #else return (s < FD_SETSIZE); diff --git a/src/init.cpp b/src/init.cpp index 7905b268e..fe10401a8 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -40,7 +40,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif @@ -74,7 +74,7 @@ bool fFeeEstimatesInitialized = false; static CZMQNotificationInterface* pzmqNotificationInterface = NULL; #endif -#ifdef WIN32 +#ifdef _WIN32 // Win32 LevelDB doesn't use file descriptors, and the ones used for // accessing block files don't count towards the fd_set size limit // anyway. @@ -236,7 +236,7 @@ void Shutdown() } #endif -#ifndef WIN32 +#ifndef _WIN32 try { boost::filesystem::remove(GetPidFile()); } catch (const boost::filesystem::filesystem_error& e) { @@ -334,7 +334,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-maxorphantx=", strprintf(_("Keep at most unconnectable transactions in memory (default: %u)"), DEFAULT_MAX_ORPHAN_TRANSACTIONS)); strUsage += HelpMessageOpt("-par=", strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"), -(int)boost::thread::hardware_concurrency(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS)); -#ifndef WIN32 +#ifndef _WIN32 strUsage += HelpMessageOpt("-pid=", strprintf(_("Specify pid file (default: %s)"), "komodod.pid")); #endif strUsage += HelpMessageOpt("-prune=", strprintf(_("Reduce storage requirements by pruning (deleting) old blocks. This mode disables wallet support and is incompatible with -txindex. " @@ -716,7 +716,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) // Disable confusing "helpful" text message on abort, Ctrl-C _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); #endif -#ifdef WIN32 +#ifdef _WIN32 // Enable Data Execution Prevention (DEP) // Minimum supported OS versions: WinXP SP3, WinVista >= SP1, Win Server 2008 // A failure is non-critical and needs no further attention! @@ -733,7 +733,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) if (!SetupNetworking()) return InitError("Error: Initializing networking failed"); -#ifndef WIN32 +#ifndef _WIN32 if (GetBoolArg("-sysperms", false)) { #ifdef ENABLE_WALLET if (!GetBoolArg("-disablewallet", false)) @@ -1047,7 +1047,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Komodo is probably already running.") + " %s.", strDataDir, e.what())); } -#ifndef WIN32 +#ifndef _WIN32 CreatePidFile(GetPidFile(), getpid()); #endif if (GetBoolArg("-shrinkdebugfile", !fDebug)) diff --git a/src/komodo_pax.h b/src/komodo_pax.h index 55b14bd4a..f5655e6f1 100644 --- a/src/komodo_pax.h +++ b/src/komodo_pax.h @@ -233,7 +233,7 @@ int32_t komodo_pax_opreturn(int32_t height,uint8_t *opret,int32_t maxsize) { static uint32_t lastcrc; FILE *fp; char fname[512]; uint32_t crc32,check,timestamp; int32_t i,n=0,retval,fsize,len=0; uint8_t data[8192]; -#ifdef WIN32 +#ifdef _WIN32 sprintf(fname,"%s\\%s",GetDataDir(false).string().c_str(),(char *)"komodofeed"); #else sprintf(fname,"%s/%s",GetDataDir(false).string().c_str(),(char *)"komodofeed"); diff --git a/src/komodo_structs.h b/src/komodo_structs.h index a35e7e008..510a7e488 100644 --- a/src/komodo_structs.h +++ b/src/komodo_structs.h @@ -16,7 +16,7 @@ #include "uthash.h" #include "utlist.h" -/*#ifdef WIN32 +/*#ifdef _WIN32 #define PACKED #else #define PACKED __attribute__((packed)) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index e330a66ac..e3749a5b1 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1305,7 +1305,7 @@ void komodo_statefname(char *fname,char *symbol,char *str) } else { -#ifdef WIN32 +#ifdef _WIN32 strcat(fname,"\\"); #else strcat(fname,"/"); @@ -1315,7 +1315,7 @@ void komodo_statefname(char *fname,char *symbol,char *str) { strcat(fname,symbol); //printf("statefname.(%s) -> (%s)\n",symbol,fname); -#ifdef WIN32 +#ifdef _WIN32 strcat(fname,"\\"); #else strcat(fname,"/"); @@ -1347,7 +1347,7 @@ void komodo_configfile(char *symbol,uint16_t port) password[i*2] = 0; sprintf(buf,"%s.conf",symbol); BITCOIND_PORT = port; -#ifdef WIN32 +#ifdef _WIN32 sprintf(fname,"%s\\%s",GetDataDir(false).string().c_str(),buf); #else sprintf(fname,"%s/%s",GetDataDir(false).string().c_str(),buf); @@ -1371,7 +1371,7 @@ void komodo_configfile(char *symbol,uint16_t port) } } strcpy(fname,GetDataDir().string().c_str()); -#ifdef WIN32 +#ifdef _WIN32 while ( fname[strlen(fname)-1] != '\\' ) fname[strlen(fname)-1] = 0; strcat(fname,"komodo.conf"); @@ -1576,7 +1576,7 @@ void komodo_args(char *argv0) for (iter=0; iter<2; iter++) { strcpy(fname,GetDataDir().string().c_str()); -#ifdef WIN32 +#ifdef _WIN32 while ( fname[strlen(fname)-1] != '\\' ) fname[strlen(fname)-1] = 0; if ( iter == 0 ) diff --git a/src/metrics.cpp b/src/metrics.cpp index 92e4b6590..b45b5dc6b 100644 --- a/src/metrics.cpp +++ b/src/metrics.cpp @@ -411,7 +411,7 @@ void ThreadShowMetricsScreen() // Get current window size if (isTTY) { - #ifdef WIN32 +#ifdef _WIN32 CONSOLE_SCREEN_BUFFER_INFO csbi; GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); cols = csbi.srWindow.Right - csbi.srWindow.Left + 1; @@ -421,7 +421,7 @@ void ThreadShowMetricsScreen() if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1 && w.ws_col != 0) { cols = w.ws_col; } - #endif +#endif } if (isScreen) { diff --git a/src/net.cpp b/src/net.cpp index 073353be5..0dcdae7db 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -17,7 +17,7 @@ #include "ui_interface.h" #include "crypto/common.h" -#ifdef WIN32 +#ifdef _WIN32 #include #else #include @@ -42,7 +42,7 @@ // Fix for ancient MinGW versions, that don't have defined these in ws2tcpip.h. // Todo: Can be removed when our pull-tester is upgraded to a modern MinGW version. -#ifdef WIN32 +#ifdef _WIN32 #ifndef PROTECTION_LEVEL_UNRESTRICTED #define PROTECTION_LEVEL_UNRESTRICTED 10 #endif @@ -930,7 +930,7 @@ static void AcceptConnection(const ListenSocket& hListenSocket) { // According to the internet TCP_NODELAY is not carried into accepted sockets // on all platforms. Set it again here just to be sure. int set = 1; -#ifdef WIN32 +#ifdef _WIN32 setsockopt(hSocket, IPPROTO_TCP, TCP_NODELAY, (const char*)&set, sizeof(int)); #else setsockopt(hSocket, IPPROTO_TCP, TCP_NODELAY, (void*)&set, sizeof(int)); @@ -1727,7 +1727,7 @@ bool BindListenPort(const CService &addrBind, string& strError, bool fWhiteliste } -#ifndef WIN32 +#ifndef _WIN32 #ifdef SO_NOSIGPIPE // Different way of disabling SIGPIPE on BSD setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&nOne, sizeof(int)); @@ -1753,13 +1753,13 @@ bool BindListenPort(const CService &addrBind, string& strError, bool fWhiteliste // and enable it by default or not. Try to enable it, if possible. if (addrBind.IsIPv6()) { #ifdef IPV6_V6ONLY -#ifdef WIN32 +#ifdef _WIN32 setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&nOne, sizeof(int)); #else setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&nOne, sizeof(int)); #endif #endif -#ifdef WIN32 +#ifdef _WIN32 int nProtLevel = PROTECTION_LEVEL_UNRESTRICTED; setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_PROTECTION_LEVEL, (const char*)&nProtLevel, sizeof(int)); #endif @@ -1800,7 +1800,7 @@ void static Discover(boost::thread_group& threadGroup) if (!fDiscover) return; -#ifdef WIN32 +#ifdef _WIN32 // Get local host IP char pszHostName[256] = ""; if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR) @@ -1945,7 +1945,7 @@ public: delete pnodeLocalHost; pnodeLocalHost = NULL; -#ifdef WIN32 +#ifdef _WIN32 // Shutdown Windows Sockets WSACleanup(); #endif diff --git a/src/net.h b/src/net.h index bb79acf17..6f28f3872 100644 --- a/src/net.h +++ b/src/net.h @@ -22,7 +22,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif diff --git a/src/netbase.cpp b/src/netbase.cpp index c65d66ac1..6a28532f1 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -26,7 +26,7 @@ #include #endif -#ifndef WIN32 +#ifndef _WIN32 #if HAVE_INET_PTON #include #endif @@ -129,7 +129,7 @@ bool static LookupIntern(const char *pszName, std::vector& vIP, unsign aiHint.ai_socktype = SOCK_STREAM; aiHint.ai_protocol = IPPROTO_TCP; aiHint.ai_family = AF_UNSPEC; -#ifdef WIN32 +#ifdef _WIN32 aiHint.ai_flags = fAllowLookup ? 0 : AI_NUMERICHOST; #else aiHint.ai_flags = fAllowLookup ? AI_ADDRCONFIG : AI_NUMERICHOST; @@ -454,7 +454,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe #endif //Disable Nagle's algorithm -#ifdef WIN32 +#ifdef _WIN32 setsockopt(hSocket, IPPROTO_TCP, TCP_NODELAY, (const char*)&set, sizeof(int)); #else setsockopt(hSocket, IPPROTO_TCP, TCP_NODELAY, (void*)&set, sizeof(int)); @@ -488,7 +488,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe return false; } socklen_t nRetSize = sizeof(nRet); -#ifdef WIN32 +#ifdef _WIN32 if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, (char*)(&nRet), &nRetSize) == SOCKET_ERROR) #else if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, &nRet, &nRetSize) == SOCKET_ERROR) @@ -505,7 +505,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe return false; } } -#ifdef WIN32 +#ifdef _WIN32 else if (WSAGetLastError() != WSAEISCONN) #else else @@ -1348,7 +1348,7 @@ bool operator<(const CSubNet& a, const CSubNet& b) return (a.network < b.network || (a.network == b.network && memcmp(a.netmask, b.netmask, 16) < 0)); } -#ifdef WIN32 +#ifdef _WIN32 std::string NetworkErrorString(int err) { char buf[256]; @@ -1386,7 +1386,7 @@ bool CloseSocket(SOCKET& hSocket) { if (hSocket == INVALID_SOCKET) return false; -#ifdef WIN32 +#ifdef _WIN32 int ret = closesocket(hSocket); #else int ret = close(hSocket); @@ -1398,7 +1398,7 @@ bool CloseSocket(SOCKET& hSocket) bool SetSocketNonBlocking(SOCKET& hSocket, bool fNonBlocking) { if (fNonBlocking) { -#ifdef WIN32 +#ifdef _WIN32 u_long nOne = 1; if (ioctlsocket(hSocket, FIONBIO, &nOne) == SOCKET_ERROR) { #else @@ -1409,7 +1409,7 @@ bool SetSocketNonBlocking(SOCKET& hSocket, bool fNonBlocking) return false; } } else { -#ifdef WIN32 +#ifdef _WIN32 u_long nZero = 0; if (ioctlsocket(hSocket, FIONBIO, &nZero) == SOCKET_ERROR) { #else diff --git a/src/netbase.h b/src/netbase.h index 21ac0aa4c..83ce22663 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -22,7 +22,7 @@ extern bool fNameLookup; /** -timeout default */ static const int DEFAULT_CONNECT_TIMEOUT = 5000; -#ifdef WIN32 +#ifdef _WIN32 // In MSVC, this is defined as a macro, undefine it to prevent a compile and link error #undef SetPort #endif diff --git a/src/protocol.cpp b/src/protocol.cpp index dd855aa33..33b9ee773 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -8,7 +8,7 @@ #include "util.h" #include "utilstrencodings.h" -#ifndef WIN32 +#ifndef _WIN32 # include #endif diff --git a/src/random.cpp b/src/random.cpp index 29faa32a7..87b3f648e 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -6,7 +6,7 @@ #include "random.h" #include "support/cleanse.h" -#ifdef WIN32 +#ifdef _WIN32 #include "compat.h" // for Windows API #endif #include "serialize.h" // for begin_ptr(vec) @@ -15,7 +15,7 @@ #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif @@ -24,7 +24,7 @@ static inline int64_t GetPerformanceCounter() { int64_t nCounter = 0; -#ifdef WIN32 +#ifdef _WIN32 QueryPerformanceCounter((LARGE_INTEGER*)&nCounter); #else timeval t; diff --git a/src/support/pagelocker.cpp b/src/support/pagelocker.cpp index 440e0a519..d0b0d4dd8 100644 --- a/src/support/pagelocker.cpp +++ b/src/support/pagelocker.cpp @@ -8,7 +8,7 @@ #include "config/bitcoin-config.h" #endif -#ifdef WIN32 +#ifdef _WIN32 #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif @@ -49,7 +49,7 @@ static inline size_t GetSystemPageSize() bool MemoryPageLocker::Lock(const void* addr, size_t len) { -#ifdef WIN32 +#ifdef _WIN32 return VirtualLock(const_cast(addr), len) != 0; #else return mlock(addr, len) == 0; @@ -58,7 +58,7 @@ bool MemoryPageLocker::Lock(const void* addr, size_t len) bool MemoryPageLocker::Unlock(const void* addr, size_t len) { -#ifdef WIN32 +#ifdef _WIN32 return VirtualUnlock(const_cast(addr), len) != 0; #else return munlock(addr, len) == 0; diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp index ab3841c48..ef607dacc 100644 --- a/src/test/alert_tests.cpp +++ b/src/test/alert_tests.cpp @@ -340,7 +340,7 @@ BOOST_AUTO_TEST_CASE(AlertNotify) // Windows built-in echo semantics are different than posixy shells. Quotes and // whitespace are printed literally. -#ifndef WIN32 +#ifndef _WIN32 BOOST_CHECK_EQUAL(r[0], "Alert 1"); BOOST_CHECK_EQUAL(r[1], "Alert 2, cancels 1"); BOOST_CHECK_EQUAL(r[2], "Alert 2, cancels 1"); diff --git a/src/util.cpp b/src/util.cpp index b452cea72..ec83e17ce 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -23,7 +23,7 @@ #include #endif -#ifndef WIN32 +#ifndef _WIN32 // for posix_fallocate #ifdef __linux__ @@ -335,7 +335,7 @@ void ParseParameters(int argc, const char* const argv[]) strValue = str.substr(is_index+1); str = str.substr(0, is_index); } -#ifdef WIN32 +#ifdef _WIN32 boost::to_lower(str); if (boost::algorithm::starts_with(str, "/")) str = "-" + str.substr(1); @@ -419,7 +419,7 @@ std::string HelpMessageOpt(const std::string &option, const std::string &message static std::string FormatException(const std::exception* pex, const char* pszThread) { -#ifdef WIN32 +#ifdef _WIN32 char pszModule[MAX_PATH] = ""; GetModuleFileNameA(NULL, pszModule, sizeof(pszModule)); #else @@ -455,7 +455,7 @@ boost::filesystem::path GetDefaultDataDir() // Windows >= Vista: C:\Users\Username\AppData\Roaming\Zcash // Mac: ~/Library/Application Support/Zcash // Unix: ~/.zcash -#ifdef WIN32 +#ifdef _WIN32 // Windows if ( symbol[0] == 0 ) return GetSpecialFolderPath(CSIDL_APPDATA) / "Komodo"; @@ -502,7 +502,7 @@ static boost::filesystem::path ZC_GetBaseParamsDir() // Windows >= Vista: C:\Users\Username\AppData\Roaming\ZcashParams // Mac: ~/Library/Application Support/ZcashParams // Unix: ~/.zcash-params -#ifdef WIN32 +#ifdef _WIN32 // Windows return GetSpecialFolderPath(CSIDL_APPDATA) / "ZcashParams"; #else @@ -648,7 +648,7 @@ void ReadConfigFile(map& mapSettingsRet, //fprintf(stderr,"from conf file %s RPC %u, used to be %u\n",ASSETCHAINS_SYMBOL,BITCOIND_PORT,BITCOIND_PORT); } -#ifndef WIN32 +#ifndef _WIN32 boost::filesystem::path GetPidFile() { boost::filesystem::path pathPidFile(GetArg("-pid", "komodod.pid")); @@ -669,13 +669,13 @@ void CreatePidFile(const boost::filesystem::path &path, pid_t pid) bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest) { -#ifdef WIN32 +#ifdef _WIN32 return MoveFileExA(src.string().c_str(), dest.string().c_str(), MOVEFILE_REPLACE_EXISTING) != 0; #else int rc = std::rename(src.string().c_str(), dest.string().c_str()); return (rc == 0); -#endif /* WIN32 */ +#endif /* _WIN32 */ } /** @@ -700,7 +700,7 @@ bool TryCreateDirectory(const boost::filesystem::path& p) void FileCommit(FILE *fileout) { fflush(fileout); // harmless if redundantly called -#ifdef WIN32 +#ifdef _WIN32 HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(fileout)); FlushFileBuffers(hFile); #else @@ -815,7 +815,7 @@ void ShrinkDebugFile() fclose(file); } -#ifdef WIN32 +#ifdef _WIN32 boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate) { namespace fs = boost::filesystem; @@ -838,7 +838,7 @@ boost::filesystem::path GetTempPath() { #else // TODO: remove when we don't support filesystem v2 anymore boost::filesystem::path path; -#ifdef WIN32 +#ifdef _WIN32 char pszPath[MAX_PATH] = ""; if (GetTempPathA(MAX_PATH, pszPath)) @@ -898,7 +898,7 @@ void SetupEnvironment() bool SetupNetworking() { -#ifdef WIN32 +#ifdef _WIN32 // Initialize Windows Sockets WSADATA wsadata; int ret = WSAStartup(MAKEWORD(2,2), &wsadata); @@ -910,15 +910,15 @@ bool SetupNetworking() void SetThreadPriority(int nPriority) { -#ifdef WIN32 +#ifdef _WIN32 SetThreadPriority(GetCurrentThread(), nPriority); -#else // WIN32 +#else // _WIN32 #ifdef PRIO_THREAD setpriority(PRIO_THREAD, 0, nPriority); #else // PRIO_THREAD setpriority(PRIO_PROCESS, 0, nPriority); #endif // PRIO_THREAD -#endif // WIN32 +#endif // _WIN32 } std::string PrivacyInfo() diff --git a/src/util.h b/src/util.h index 361a9271f..424c6693a 100644 --- a/src/util.h +++ b/src/util.h @@ -124,7 +124,7 @@ boost::filesystem::path GetDefaultDataDir(); const boost::filesystem::path &GetDataDir(bool fNetSpecific = true); void ClearDatadirCache(); boost::filesystem::path GetConfigFile(); -#ifndef WIN32 +#ifndef _WIN32 boost::filesystem::path GetPidFile(); void CreatePidFile(const boost::filesystem::path &path, pid_t pid); #endif @@ -133,7 +133,7 @@ public: missing_zcash_conf() : std::runtime_error("Missing komodo.conf") { } }; void ReadConfigFile(std::map& mapSettingsRet, std::map >& mapMultiSettingsRet); -#ifdef WIN32 +#ifdef _WIN32 boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true); #endif boost::filesystem::path GetTempPath(); @@ -150,7 +150,7 @@ std::string LicenseInfo(); inline bool IsSwitchChar(char c) { -#ifdef WIN32 +#ifdef _WIN32 return c == '-' || c == '/'; #else return c == '-'; diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp index 766e2afda..c6beb8a52 100644 --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -13,7 +13,7 @@ #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif