Test
This commit is contained in:
@@ -996,9 +996,7 @@ int32_t komodo_staked(uint256 *utxotxidp,int32_t *utxovoutp,uint64_t *utxovaluep
|
|||||||
memset(utxotxidp,0,sizeof(*utxotxidp));
|
memset(utxotxidp,0,sizeof(*utxotxidp));
|
||||||
memset(utxovoutp,0,sizeof(*utxovoutp));
|
memset(utxovoutp,0,sizeof(*utxovoutp));
|
||||||
memset(utxosig,0,72);
|
memset(utxosig,0,72);
|
||||||
fprintf(stderr,"start listunspent\n");
|
|
||||||
komodo_listunspent();
|
komodo_listunspent();
|
||||||
fprintf(stderr,"listunspent done\n");
|
|
||||||
return(72);
|
return(72);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2693,7 +2693,7 @@ UniValue listunspent(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
void komodo_listunspent()
|
void komodo_listunspent()
|
||||||
{
|
{
|
||||||
set<CBitcoinAddress> setAddress; int32_t nMinDepth = 1,nMaxDepth = 9999999; vector<COutput> vecOutputs; CTxDestination address;
|
set<CBitcoinAddress> setAddress; int32_t nMinDepth = 1,nMaxDepth = 9999999; vector<COutput> vecOutputs;
|
||||||
assert(pwalletMain != NULL);
|
assert(pwalletMain != NULL);
|
||||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||||
pwalletMain->AvailableCoins(vecOutputs, false, NULL, true);
|
pwalletMain->AvailableCoins(vecOutputs, false, NULL, true);
|
||||||
@@ -2703,6 +2703,7 @@ void komodo_listunspent()
|
|||||||
continue;
|
continue;
|
||||||
if ( setAddress.size() )
|
if ( setAddress.size() )
|
||||||
{
|
{
|
||||||
|
CTxDestination address;
|
||||||
if (!ExtractDestination(out.tx->vout[out.i].scriptPubKey, address))
|
if (!ExtractDestination(out.tx->vout[out.i].scriptPubKey, address))
|
||||||
continue;
|
continue;
|
||||||
if (!setAddress.count(address))
|
if (!setAddress.count(address))
|
||||||
@@ -2710,17 +2711,15 @@ void komodo_listunspent()
|
|||||||
}
|
}
|
||||||
CAmount nValue = out.tx->vout[out.i].nValue;
|
CAmount nValue = out.tx->vout[out.i].nValue;
|
||||||
const CScript& pk = out.tx->vout[out.i].scriptPubKey;
|
const CScript& pk = out.tx->vout[out.i].scriptPubKey;
|
||||||
/*UniValue entry(UniValue::VOBJ);
|
//entry.push_back(Pair("generated", out.tx->IsCoinBase()));
|
||||||
entry.push_back(Pair("txid", out.tx->GetHash().GetHex()));
|
|
||||||
entry.push_back(Pair("vout", out.i));
|
|
||||||
entry.push_back(Pair("generated", out.tx->IsCoinBase()));
|
|
||||||
CTxDestination address;
|
CTxDestination address;
|
||||||
if (ExtractDestination(out.tx->vout[out.i].scriptPubKey, address)) {
|
if (ExtractDestination(out.tx->vout[out.i].scriptPubKey, address))
|
||||||
entry.push_back(Pair("address", CBitcoinAddress(address).ToString()));
|
{
|
||||||
if (pwalletMain->mapAddressBook.count(address))
|
//entry.push_back(Pair("address", CBitcoinAddress(address).ToString()));
|
||||||
entry.push_back(Pair("account", pwalletMain->mapAddressBook[address].name));
|
//if (pwalletMain->mapAddressBook.count(address))
|
||||||
|
// entry.push_back(Pair("account", pwalletMain->mapAddressBook[address].name));
|
||||||
}
|
}
|
||||||
entry.push_back(Pair("scriptPubKey", HexStr(pk.begin(), pk.end())));
|
/*entry.push_back(Pair("scriptPubKey", HexStr(pk.begin(), pk.end())));
|
||||||
if (pk.IsPayToScriptHash())
|
if (pk.IsPayToScriptHash())
|
||||||
{
|
{
|
||||||
CTxDestination address;
|
CTxDestination address;
|
||||||
@@ -2745,7 +2744,6 @@ void komodo_listunspent()
|
|||||||
}
|
}
|
||||||
fprintf(stderr,"(%s) %s/v%d nValue %.8f locktime.%u txheight.%d pindexht.%d\n",CBitcoinAddress(address).ToString().c_str(),out.tx->GetHash().GetHex().c_str(),out.i,(double)nValue/COIN,locktime,txheight,pindex->nHeight);
|
fprintf(stderr,"(%s) %s/v%d nValue %.8f locktime.%u txheight.%d pindexht.%d\n",CBitcoinAddress(address).ToString().c_str(),out.tx->GetHash().GetHex().c_str(),out.i,(double)nValue/COIN,locktime,txheight,pindex->nHeight);
|
||||||
}
|
}
|
||||||
fprintf(stderr,"entry done\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user