diff --git a/src/cc/CCPayments.h b/src/cc/CCPayments.h index 13c66d358..a7cd4f916 100644 --- a/src/cc/CCPayments.h +++ b/src/cc/CCPayments.h @@ -19,6 +19,7 @@ #include "CCinclude.h" #include +#include #define PAYMENTS_TXFEE 10000 #define PAYMENTS_MERGEOFSET 10 // 100? diff --git a/src/cc/payments.cpp b/src/cc/payments.cpp index 6311e393d..ce817ac0d 100644 --- a/src/cc/payments.cpp +++ b/src/cc/payments.cpp @@ -1208,16 +1208,22 @@ UniValue PaymentsAirdrop(struct CCcontract_info *cp,char *jsonstr) { for (i=0; i vscriptPubKey; CScript scriptPubKey = GetScriptForDestination(destination); - */ - char *inputhex = jstri(params,6+i); - std::vector scriptPubKey; - int32_t len = strlen(inputhex)/2; - scriptPubKey.resize(len); - decode_hex((uint8_t *)scriptPubKey.data(),len,(char *)inputhex); - excludeScriptPubKeys.push_back(scriptPubKey); + vscriptPubKey.assign(scriptPubKey.begin(), scriptPubKey.end()); + excludeScriptPubKeys.push_back(vscriptPubKey); } } mypk = pubkey2pk(Mypubkey()); @@ -1331,10 +1337,13 @@ UniValue PaymentsInfo(struct CCcontract_info *cp,char *jsonstr) result.push_back(Pair("bottom",(int64_t)bottom)); result.push_back(Pair("top",(int64_t)top)); result.push_back(Pair("fixedFlag",(int64_t)fixedAmount)); - // TODO: convert to show addresses instead of scriptpubkey. for ( auto scriptPubKey : excludeScriptPubKeys ) - a.push_back(HexStr(scriptPubKey.begin(),scriptPubKey.end())); - result.push_back(Pair("excludeScriptPubkeys",a)); + { + CTxDestination dest; + if ( ExtractDestination(CScript(scriptPubKey.begin(),scriptPubKey.end()), dest) ) + a.push_back(CBitcoinAddress(dest).ToString()); + } + result.push_back(Pair("excludeAddresses",a)); } else if ( DecodePaymentsTokensOpRet(tx.vout[tx.vout.size()-1].scriptPubKey,lockedblocks,minrelease,top,excludeScriptPubKeys,tokenid) != 0 ) { diff --git a/src/main.cpp b/src/main.cpp index 1ec1d1560..5203888de 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -731,7 +731,7 @@ bool komodo_dailysnapshot(int32_t height) std::sort(vAddressSnapshot.rbegin(), vAddressSnapshot.rend()); //for (int j = 0; j < 50; j++) // fprintf(stderr, "j.%i address.%s nValue.%li\n",j, CBitcoinAddress(vAddressSnapshot[j].second).ToString().c_str(), vAddressSnapshot[j].first ); - // include only top 5000 address. + // include only top 3999 address. if ( vAddressSnapshot.size() > 3999 ) vAddressSnapshot.resize(3999); lastSnapShotHeight = undo_height; fprintf(stderr, "vAddressSnapshot.size.%li\n", vAddressSnapshot.size());