Connect addressutxos to addnormalinputs

This commit is contained in:
jl777
2019-07-10 06:21:04 -11:00
parent b893cd5416
commit 86d6ba3d87
3 changed files with 23 additions and 1 deletions

View File

@@ -408,8 +408,16 @@ UniValue NSPV_spend(char *srcaddr,char *destaddr,int64_t satoshis) // what its a
int64_t NSPV_AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int32_t maxinputs,struct NSPV_CCmtxinfo *ptr)
{
char coinaddr[64]; int32_t CCflag = 0;
if ( ptr != 0 )
{
Getscriptaddress(coinaddr,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG);
if ( strcmp(ptr->U.coinaddr,coinaddr) != 0 )
{
NSPV_addressutxos(coinaddr,CCflag);
NSPV_utxosresp_purge(&ptr->U);
NSPV_utxosresp_copy(&ptr->U,&NSPV_utxosresult);
}
memset(ptr->used,0,sizeof(ptr->used));
return(NSPV_addinputs(ptr->used,mtx,total,maxinputs,ptr->U.utxos,ptr->U.numutxos));
} else return(0);