@ -142,7 +142,7 @@ char *LP_zeroconf_claim(struct iguana_info *coin,char *depositaddr,uint32_t expi
redeemlen = LP_deposit_addr ( vinaddr , redeemscript , coin - > taddr , coin - > p2shtype , timestamp , G . LP_pubsecp ) ;
redeemlen = LP_deposit_addr ( vinaddr , redeemscript , coin - > taddr , coin - > p2shtype , timestamp , G . LP_pubsecp ) ;
if ( strcmp ( depositaddr , vinaddr ) = = 0 )
if ( strcmp ( depositaddr , vinaddr ) = = 0 )
{
{
claimtime = ( uint32_t ) time ( NULL ) - 777 / 2 ;
claimtime = ( uint32_t ) time ( NULL ) - 777 ;
if ( claimtime < = timestamp )
if ( claimtime < = timestamp )
{
{
printf ( " claimtime.%u vs locktime.%u, need to wait %d seconds \n " , claimtime , timestamp , ( int32_t ) timestamp - claimtime ) ;
printf ( " claimtime.%u vs locktime.%u, need to wait %d seconds \n " , claimtime , timestamp , ( int32_t ) timestamp - claimtime ) ;
@ -155,12 +155,14 @@ char *LP_zeroconf_claim(struct iguana_info *coin,char *depositaddr,uint32_t expi
userdata [ 0 ] = 0x51 ;
userdata [ 0 ] = 0x51 ;
userdatalen = 1 ;
userdatalen = 1 ;
utxovout = 0 ;
utxovout = 0 ;
//printf("unspents.(%s)\n",jprint(array,0));
if ( ( n = cJSON_GetArraySize ( array ) ) > 0 )
if ( ( n = cJSON_GetArraySize ( array ) ) > 0 )
{
{
for ( i = 0 ; i < n ; i + + )
for ( i = 0 ; i < n ; i + + )
{
{
item = jitem ( array , i ) ;
item = jitem ( array , i ) ;
satoshis = LP_listunspent_parseitem ( coin , & utxotxid , & utxovout , & height , item ) ;
satoshis = LP_listunspent_parseitem ( coin , & utxotxid , & utxovout , & height , item ) ;
printf ( " satoshis %.8f %s/v%d \n " , dstr ( satoshis ) , bits256_str ( str , utxotxid ) , utxovout ) ;
if ( ( signedtx = basilisk_swap_bobtxspend ( & signedtxid , 10000 , " zeroconfclaim " , coin - > symbol , coin - > wiftaddr , coin - > taddr , coin - > pubtype , coin - > p2shtype , coin - > isPoS , coin - > wiftype , ctx , G . LP_privkey , 0 , redeemscript , redeemlen , userdata , userdatalen , utxotxid , utxovout , coin - > smartaddr , G . LP_pubsecp , 0 , claimtime , & destamount , 0 , 0 , vinaddr , 1 , coin - > zcash ) ) ! = 0 )
if ( ( signedtx = basilisk_swap_bobtxspend ( & signedtxid , 10000 , " zeroconfclaim " , coin - > symbol , coin - > wiftaddr , coin - > taddr , coin - > pubtype , coin - > p2shtype , coin - > isPoS , coin - > wiftype , ctx , G . LP_privkey , 0 , redeemscript , redeemlen , userdata , userdatalen , utxotxid , utxovout , coin - > smartaddr , G . LP_pubsecp , 0 , claimtime , & destamount , 0 , 0 , vinaddr , 1 , coin - > zcash ) ) ! = 0 )
{
{
printf ( " signedtx.(%s) \n " , signedtx ) ;
printf ( " signedtx.(%s) \n " , signedtx ) ;