|
|
@ -556,7 +556,7 @@ struct basilisk_rawtx *LP_swapdata_rawtx(struct basilisk_swap *swap,uint8_t *dat |
|
|
|
|
|
|
|
int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct basilisk_rawtx *rawtx,int32_t v,uint8_t *recvbuf,int32_t recvlen,int32_t suppress_pubkeys) |
|
|
|
{ |
|
|
|
bits256 otherhash,myhash,txid; int64_t txfee; int32_t i,offset=0,datalen=0,retval=-1,hexlen,n; uint8_t *data; cJSON *txobj,*skey,*vouts,*vout; char *hexstr,redeemaddr[64],checkaddr[64]; uint32_t quoteid,msgbits; |
|
|
|
bits256 otherhash,myhash,txid; int64_t txfee,val; int32_t i,offset=0,datalen=0,retval=-1,hexlen,n; uint8_t *data; cJSON *txobj,*skey,*vouts,*vout; char *hexstr,redeemaddr[64],checkaddr[64]; uint32_t quoteid,msgbits; |
|
|
|
for (i=0; i<32; i++) |
|
|
|
otherhash.bytes[i] = recvbuf[offset++]; |
|
|
|
for (i=0; i<32; i++) |
|
|
@ -626,7 +626,10 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba |
|
|
|
txfee = swap->I.Atxfee; |
|
|
|
else txfee = LP_MIN_TXFEE; |
|
|
|
} |
|
|
|
if ( j64bits(vout,"satoshis") >= rawtx->I.amount-2*txfee && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) |
|
|
|
if ( rawtx->I.amount > 2*txfee) |
|
|
|
val = rawtx->I.amount-2*txfee; |
|
|
|
else val = 1; |
|
|
|
if ( j64bits(vout,"satoshis") >= val && (skey= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(skey,"hex")) != 0 ) |
|
|
|
{ |
|
|
|
if ( (hexlen= (int32_t)strlen(hexstr) >> 1) < sizeof(rawtx->spendscript) ) |
|
|
|
{ |
|
|
|