|
|
@ -234,6 +234,9 @@ cJSON *LP_inventoryjson(cJSON *item,struct LP_utxoinfo *utxo) |
|
|
|
{ |
|
|
|
struct _LP_utxoinfo u; |
|
|
|
jaddstr(item,"method","utxo"); |
|
|
|
if ( LP_ismine(utxo) > 0 ) |
|
|
|
jaddnum(item,"session",LP_sessionid); |
|
|
|
else jaddnum(item,"session",utxo->T.sessionid); |
|
|
|
if ( utxo == 0 ) |
|
|
|
return(item); |
|
|
|
if ( utxo->gui[0] != 0 ) |
|
|
@ -495,7 +498,7 @@ void LP_utxo_clientpublish(struct LP_utxoinfo *utxo) |
|
|
|
return(n);*/ |
|
|
|
} |
|
|
|
|
|
|
|
struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,char *gui) |
|
|
|
struct LP_utxoinfo *LP_utxoadd(int32_t iambob,int32_t mypubsock,char *symbol,bits256 txid,int32_t vout,int64_t value,bits256 txid2,int32_t vout2,int64_t value2,char *spendscript,char *coinaddr,bits256 pubkey,char *gui,uint32_t sessionid) |
|
|
|
{ |
|
|
|
uint64_t val,val2=0,tmpsatoshis,bigtxfee = 100000; int32_t spendvini,selector; bits256 spendtxid; struct iguana_info *coin; struct _LP_utxoinfo u; struct LP_utxoinfo *utxo = 0; |
|
|
|
if ( symbol == 0 || symbol[0] == 0 || spendscript == 0 || spendscript[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(txid2) == 0 || vout < 0 || vout2 < 0 || value <= 0 || value2 <= 0 ) |
|
|
@ -610,7 +613,7 @@ struct LP_utxoinfo *LP_utxoaddjson(int32_t iambob,int32_t pubsock,cJSON *argjson |
|
|
|
return(0); |
|
|
|
} |
|
|
|
portable_mutex_lock(&LP_UTXOmutex); |
|
|
|
utxo = LP_utxoadd(iambob,pubsock,jstr(argjson,"coin"),jbits256(argjson,"txid"),jint(argjson,"vout"),j64bits(argjson,"value"),jbits256(argjson,"txid2"),jint(argjson,"vout2"),j64bits(argjson,"value2"),jstr(argjson,"script"),jstr(argjson,"address"),jbits256(argjson,"pubkey"),jstr(argjson,"gui")); |
|
|
|
utxo = LP_utxoadd(iambob,pubsock,jstr(argjson,"coin"),jbits256(argjson,"txid"),jint(argjson,"vout"),j64bits(argjson,"value"),jbits256(argjson,"txid2"),jint(argjson,"vout2"),j64bits(argjson,"value2"),jstr(argjson,"script"),jstr(argjson,"address"),jbits256(argjson,"pubkey"),jstr(argjson,"gui"),juint(argjson,"sessionid")); |
|
|
|
portable_mutex_unlock(&LP_UTXOmutex); |
|
|
|
return(utxo); |
|
|
|
} |
|
|
@ -809,13 +812,13 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr |
|
|
|
portable_mutex_lock(&LP_UTXOmutex); |
|
|
|
if ( iambob != 0 ) |
|
|
|
{ |
|
|
|
if ( (utxo= LP_utxoadd(1,mypubsock,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,script,coin->smartaddr,mypub,LP_gui)) != 0 ) |
|
|
|
if ( (utxo= LP_utxoadd(1,mypubsock,coin->symbol,txid,vout,value,deposittxid,depositvout,depositval,script,coin->smartaddr,mypub,LP_gui,LP_sessionid)) != 0 ) |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if ( (utxo= LP_utxoadd(0,mypubsock,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,script,coin->smartaddr,mypub,LP_gui)) != 0 ) |
|
|
|
if ( (utxo= LP_utxoadd(0,mypubsock,coin->symbol,deposittxid,depositvout,depositval,txid,vout,value,script,coin->smartaddr,mypub,LP_gui,LP_sessionid)) != 0 ) |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|