Browse Source

Merge pull request #1115 from blackjok3rtt/beta

colours
patch-14
jl777 5 years ago
committed by GitHub
parent
commit
34e95478df
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      basilisk/basilisk_DEX.c
  2. 2
      iguana/dPoW.h
  3. 2
      iguana/dpow/dpow_fsm.c
  4. 4
      iguana/dpow/dpow_network.c
  5. 6
      iguana/dpow/dpow_rpc.c
  6. 3
      iguana/dpow/dpow_tx.c
  7. 2
      iguana/iguana_payments.c
  8. 18
      includes/iguana_defines.h

3
basilisk/basilisk_DEX.c

@ -532,7 +532,6 @@ char *basilisk_sendrawtransaction(struct supernet_info *myinfo,struct iguana_inf
{ {
retstr = _dex_sendrawtransaction(myinfo,coin->symbol,signedtx); retstr = _dex_sendrawtransaction(myinfo,coin->symbol,signedtx);
} }
else retstr = dpow_sendrawtransaction(myinfo,coin,signedtx); else retstr = dpow_sendrawtransaction(myinfo,coin,signedtx,0);
return(retstr); return(retstr);
} }

2
iguana/dPoW.h

@ -179,7 +179,7 @@ cJSON *dpow_gettransaction(struct supernet_info *myinfo,struct iguana_info *coin
cJSON *dpow_getblock(struct supernet_info *myinfo,struct iguana_info *coin,bits256 blockhash); cJSON *dpow_getblock(struct supernet_info *myinfo,struct iguana_info *coin,bits256 blockhash);
bits256 dpow_getblockhash(struct supernet_info *myinfo,struct iguana_info *coin,int32_t height); bits256 dpow_getblockhash(struct supernet_info *myinfo,struct iguana_info *coin,int32_t height);
bits256 dpow_getbestblockhash(struct supernet_info *myinfo,struct iguana_info *coin); bits256 dpow_getbestblockhash(struct supernet_info *myinfo,struct iguana_info *coin);
char *dpow_sendrawtransaction(struct supernet_info *myinfo,struct iguana_info *coin,char *signedtx); char *dpow_sendrawtransaction(struct supernet_info *myinfo,struct iguana_info *coin,char *signedtx, int32_t mine);
cJSON *dpow_gettxout(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid,int32_t vout); cJSON *dpow_gettxout(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid,int32_t vout);
char *dpow_importaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address); char *dpow_importaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address);
char *dpow_validateaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address); char *dpow_validateaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address);

2
iguana/dpow/dpow_fsm.c

@ -145,7 +145,7 @@ int32_t dpow_checkutxo(struct supernet_info *myinfo,struct dpow_info *dp,struct
jaddistr(addresses,coinaddr); jaddistr(addresses,coinaddr);
if ( myinfo->nosplit == 0 && (rawtx= iguana_utxoduplicates(myinfo,coin,dp->minerkey33,DPOW_UTXOSIZE,n,&completed,&signedtxid,0,addresses)) != 0 ) if ( myinfo->nosplit == 0 && (rawtx= iguana_utxoduplicates(myinfo,coin,dp->minerkey33,DPOW_UTXOSIZE,n,&completed,&signedtxid,0,addresses)) != 0 )
{ {
if ( (sendtx= dpow_sendrawtransaction(myinfo,coin,rawtx)) != 0 ) if ( (sendtx= dpow_sendrawtransaction(myinfo,coin,rawtx,0)) != 0 )
{ {
printf("sendrawtransaction.(%s)\n",sendtx); printf("sendrawtransaction.(%s)\n",sendtx);
free(sendtx); free(sendtx);

4
iguana/dpow/dpow_network.c

@ -667,7 +667,7 @@ return(clonestr("{\"error\":\"basilisk disabled\"}"));
} }
else if ( dexreq.func == 'S' ) else if ( dexreq.func == 'S' )
{ {
retstr = dpow_sendrawtransaction(myinfo,coin,(char *)&dexp->packet[datalen]); retstr = dpow_sendrawtransaction(myinfo,coin,(char *)&dexp->packet[datalen],0);
} }
else if ( dexreq.func == '*' ) else if ( dexreq.func == '*' )
{ {
@ -1999,6 +1999,7 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
bp->recvmask |= (1LL << senderind) | (1LL << bp->myind); bp->recvmask |= (1LL << senderind) | (1LL << bp->myind);
bp->bestmask = dpow_maskmin(bp->recvmask,bp,&bp->bestk); bp->bestmask = dpow_maskmin(bp->recvmask,bp,&bp->bestk);
} }
dpow_bestconsensus(dp,bp); dpow_bestconsensus(dp,bp);
if ( bp->bestk >= 0 ) if ( bp->bestk >= 0 )
bp->notaries[bp->myind].bestk = bp->bestk; bp->notaries[bp->myind].bestk = bp->bestk;
@ -2065,6 +2066,7 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
} }
if ( 1 && strcmp("KMD",dp->symbol) == 0 && bp->myind == 0 ) if ( 1 && strcmp("KMD",dp->symbol) == 0 && bp->myind == 0 )
printf("%s recv.%llx best.(%d %llx) m.%d p.%d:%d b.%d state.%d minsigs.%d pend.%d\n",dp->symbol,(long long)bp->recvmask,bp->bestk,(long long)bp->bestmask,matches,paxmatches,paxbestmatches,bestmatches,bp->state,bp->minsigs,bp->pendingbestk); printf("%s recv.%llx best.(%d %llx) m.%d p.%d:%d b.%d state.%d minsigs.%d pend.%d\n",dp->symbol,(long long)bp->recvmask,bp->bestk,(long long)bp->bestmask,matches,paxmatches,paxbestmatches,bestmatches,bp->state,bp->minsigs,bp->pendingbestk);
if ( bestmatches == bp->minsigs && paxbestmatches == bp->minsigs && bp->bestk >= 0 && bp->bestmask != 0 ) if ( bestmatches == bp->minsigs && paxbestmatches == bp->minsigs && bp->bestk >= 0 && bp->bestmask != 0 )
{ {
if ( bp->pendingbestk < 0 )//bp->pendingbestk != bp->bestk || bp->pendingbestmask != bp->bestmask ) if ( bp->pendingbestk < 0 )//bp->pendingbestk != bp->bestk || bp->pendingbestmask != bp->bestmask )

6
iguana/dpow/dpow_rpc.c

@ -762,7 +762,7 @@ cJSON *dpow_kvsearch(struct supernet_info *myinfo,struct iguana_info *coin,char
} }
char *dpow_sendrawtransaction(struct supernet_info *myinfo,struct iguana_info *coin,char *signedtx) char *dpow_sendrawtransaction(struct supernet_info *myinfo,struct iguana_info *coin,char *signedtx, int32_t mine)
{ {
bits256 txid; cJSON *json,*array; char *paramstr,*retstr; bits256 txid; cJSON *json,*array; char *paramstr,*retstr;
if ( coin->active == 0 ) return (0); if ( coin->active == 0 ) return (0);
@ -772,7 +772,9 @@ char *dpow_sendrawtransaction(struct supernet_info *myinfo,struct iguana_info *c
jaddistr(array,signedtx); jaddistr(array,signedtx);
paramstr = jprint(array,1); paramstr = jprint(array,1);
retstr = bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"sendrawtransaction",paramstr); retstr = bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"sendrawtransaction",paramstr);
printf(">>>>>>>>>>> %s dpow_sendrawtransaction (%s)\n",coin->symbol,retstr); char colour[16];
sprintf(colour,mine != 0 ? GREEN : RED);
fprintf(stderr,"%s>>>>>>>>>>> %s dpow_sendrawtransaction (%s)\n"RESET,colour,coin->symbol,retstr);
free(paramstr); free(paramstr);
return(retstr); return(retstr);
} }

3
iguana/dpow/dpow_tx.c

@ -627,7 +627,7 @@ void dpow_sigscheck(struct supernet_info *myinfo,struct dpow_info *dp,struct dpo
bp->state = 1; bp->state = 1;
if ( bits256_nonz(signedtxid) != 0 && numsigs == bp->minsigs ) if ( bits256_nonz(signedtxid) != 0 && numsigs == bp->minsigs )
{ {
if ( (retstr= dpow_sendrawtransaction(myinfo,coin,bp->signedtx)) != 0 ) if ( (retstr= dpow_sendrawtransaction(myinfo,coin,bp->signedtx,(bestmask & (1LL << bp->myind)) != 0)) != 0 )
{ {
//printf("sendrawtransaction.(%s)\n",retstr); //printf("sendrawtransaction.(%s)\n",retstr);
if ( is_hexstr(retstr,0) == sizeof(txid)*2 ) if ( is_hexstr(retstr,0) == sizeof(txid)*2 )
@ -669,4 +669,3 @@ void dpow_sigscheck(struct supernet_info *myinfo,struct dpow_info *dp,struct dpo
} else printf("numsigs.%d vs required.%d\n",numsigs,bp->minsigs); } else printf("numsigs.%d vs required.%d\n",numsigs,bp->minsigs);
} }
} }

2
iguana/iguana_payments.c

@ -303,7 +303,7 @@ bits256 iguana_sendrawtransaction(struct supernet_info *myinfo,struct iguana_inf
if ( coin->FULLNODE < 0 || coin->notarychain >= 0 ) if ( coin->FULLNODE < 0 || coin->notarychain >= 0 )
{ {
if ( coin->FULLNODE < 0 ) if ( coin->FULLNODE < 0 )
str = dpow_sendrawtransaction(myinfo,coin,signedtx); str = dpow_sendrawtransaction(myinfo,coin,signedtx,0);
else str = _dex_sendrawtransaction(myinfo,coin->symbol,signedtx); else str = _dex_sendrawtransaction(myinfo,coin->symbol,signedtx);
if ( str != 0 ) if ( str != 0 )
{ {

18
includes/iguana_defines.h

@ -211,4 +211,22 @@ extern int32_t IGUANA_NUMHELPERS;
#define IGUANA_MAXSCRIPTSIZE 10001 #define IGUANA_MAXSCRIPTSIZE 10001
#define RESET "\033[0m"
#define BLACK "\033[30m" /* Black */
#define RED "\033[31m" /* Red */
#define GREEN "\033[32m" /* Green */
#define YELLOW "\033[33m" /* Yellow */
#define BLUE "\033[34m" /* Blue */
#define MAGENTA "\033[35m" /* Magenta */
#define CYAN "\033[36m" /* Cyan */
#define WHITE "\033[37m" /* White */
#define BOLDBLACK "\033[1m\033[30m" /* Bold Black */
#define BOLDRED "\033[1m\033[31m" /* Bold Red */
#define BOLDGREEN "\033[1m\033[32m" /* Bold Green */
#define BOLDYELLOW "\033[1m\033[33m" /* Bold Yellow */
#define BOLDBLUE "\033[1m\033[34m" /* Bold Blue */
#define BOLDMAGENTA "\033[1m\033[35m" /* Bold Magenta */
#define BOLDCYAN "\033[1m\033[36m" /* Bold Cyan */
#define BOLDWHITE "\033[1m\033[37m" /* Bold White */
#endif #endif

Loading…
Cancel
Save