Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
6541ce01ff
  1. 1
      basilisk/basilisk_bitcoin.c
  2. 11
      iguana/iguana_wallet.c

1
basilisk/basilisk_bitcoin.c

@ -1097,6 +1097,7 @@ void basilisk_unspent_update(struct supernet_info *myinfo,struct iguana_info *co
printf("new unspent.%s %d script.%p [%d]\n",waddr->coinaddr,waddr->numunspents,bu.script,bu.spendlen); printf("new unspent.%s %d script.%p [%d]\n",waddr->coinaddr,waddr->numunspents,bu.script,bu.spendlen);
} }
waddr->unspents[i] = bu; waddr->unspents[i] = bu;
//PREVENT DOUBLE SPENDS!!! and use p2sh
if ( i == n && bu.spentheight != 0 && (dest= jobj(item,"dest")) != 0 ) if ( i == n && bu.spentheight != 0 && (dest= jobj(item,"dest")) != 0 )
{ {
struct basilisk_spend *s; struct basilisk_spend *s;

11
iguana/iguana_wallet.c

@ -56,7 +56,8 @@ struct iguana_waddress *iguana_waddressalloc(uint8_t addrtype,char *symbol,char
struct iguana_waccount *iguana_waccountfind(struct supernet_info *myinfo,struct iguana_info *coin,char *account) struct iguana_waccount *iguana_waccountfind(struct supernet_info *myinfo,struct iguana_info *coin,char *account)
{ {
struct iguana_waccount *wacct; struct iguana_waccount *wacct = 0;
if ( account != 0 && wacct != 0 )
HASH_FIND(hh,myinfo->wallet,account,strlen(account)+1,wacct); HASH_FIND(hh,myinfo->wallet,account,strlen(account)+1,wacct);
//printf("waccountfind.(%s) -> wacct.%p\n",account,wacct); //printf("waccountfind.(%s) -> wacct.%p\n",account,wacct);
return(wacct); return(wacct);
@ -64,7 +65,12 @@ struct iguana_waccount *iguana_waccountfind(struct supernet_info *myinfo,struct
struct iguana_waccount *iguana_waccountcreate(struct supernet_info *myinfo,struct iguana_info *coin,char *account) struct iguana_waccount *iguana_waccountcreate(struct supernet_info *myinfo,struct iguana_info *coin,char *account)
{ {
struct iguana_waccount *wacct,*ptr; int32_t len = (int32_t)strlen(account)+1; struct iguana_waccount *wacct=0,*ptr; int32_t len;
if ( account != 0 )
{
if ( account[0] == 0 )
account = "default";
len = (int32_t)strlen(account)+1;
HASH_FIND(hh,myinfo->wallet,account,len,wacct); HASH_FIND(hh,myinfo->wallet,account,len,wacct);
if ( wacct == 0 ) if ( wacct == 0 )
{ {
@ -76,6 +82,7 @@ struct iguana_waccount *iguana_waccountcreate(struct supernet_info *myinfo,struc
if ( (ptr= iguana_waccountfind(myinfo,coin,account)) != wacct ) if ( (ptr= iguana_waccountfind(myinfo,coin,account)) != wacct )
printf("iguana_waccountcreate verify error %p vs %p\n",ptr,wacct); printf("iguana_waccountcreate verify error %p vs %p\n",ptr,wacct);
} }
}
return(wacct); return(wacct);
} }

Loading…
Cancel
Save