|
|
@ -454,18 +454,23 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,char *base,char *rel,double |
|
|
|
privkey = LP_privkey(coin->symbol,coin->smartaddr,coin->taddr); |
|
|
|
if ( bits256_nonz(privkey) != 0 && bits256_cmp(G.LP_mypub25519,qp->srchash) == 0 ) |
|
|
|
{ |
|
|
|
printf("Rinit\n"); |
|
|
|
LP_requestinit(&qp->R,qp->srchash,qp->desthash,base,qp->satoshis-qp->txfee,rel,qp->destsatoshis-qp->desttxfee,qp->timestamp,qp->quotetime,DEXselector); |
|
|
|
printf("Check swaps\n"); |
|
|
|
if ( LP_pendingswap(qp->R.requestid,qp->R.quoteid) > 0 ) |
|
|
|
{ |
|
|
|
printf("requestid.%u quoteid.%u is already in progres\n",qp->R.requestid,qp->R.quoteid); |
|
|
|
return(-1); |
|
|
|
} |
|
|
|
dtrust = 0;//LP_dynamictrust(qp->othercredits,qp->desthash,LP_kmdvalue(qp->destcoin,qp->destsatoshis));
|
|
|
|
printf("calc dtrust\n"); |
|
|
|
dtrust = LP_dynamictrust(qp->othercredits,qp->desthash,LP_kmdvalue(qp->destcoin,qp->destsatoshis)); |
|
|
|
printf("swap init\n"); |
|
|
|
if ( (swap= LP_swapinit(1,0,privkey,&qp->R,qp,dtrust > 0)) == 0 ) |
|
|
|
{ |
|
|
|
printf("cant initialize swap\n"); |
|
|
|
return(-1); |
|
|
|
} |
|
|
|
printf("nanobind\n"); |
|
|
|
if ( (pair= LP_nanobind(ctx,pairstr)) >= 0 ) |
|
|
|
{ |
|
|
|
swap->N.pair = pair; |
|
|
|