Jl777 (#1315)
* Remove voutsum check * Teach RPC interface about dpow-enabled minconfs (#1231) * Make minconfs dpow-aware in z_listunspent + z_listreceivedbyaddress * Add dpow-related test files to test suite * Add dpow simulation to regtest every 7 blocks * Fix compiler errors * Fix link error * Fix stdout spam when running regtests * Dpowminconfs for listreceivedbyaddress * dpowconfs tests * Start adding specific tests for dpowminconfs in listreceivedbyaddress * Get dpowminconfs tests for listreceivedbyaddress working * Add dpowminconfs to getreceivedbyaddress + listunspent * Add test for listtransactions + getreceivedbyaddress support * Reliably passing dpowminconf tests. We only check for notarized-ness now, not exact confirmation numbers, to avoid race conditions * Poll for the expected notarization info before running further tests; add support for getbalance * Migrate tx_height() to a place where asyncrpcoperation_sendmany.cpp can use it * fix * Teach GetFilteredNotes about dpowconfs Many RPCs rely on this internal function, which now correctly uses dpowconfs to filter by the minconf/maxconf parameters. * Fix sendmany when using non-default minconf * inline seems to make things happy * cleanup * Add some code to test z_sendmany, which points out https://github.com/jl777/komodo/issues/1247 * try this * Use already calculated value of dpowconfs instead of calculating it again * Cleanup .pack file * Remove * Remove .pack * Disable passkeys * Rvalidate * Syntax * Allow overwrite by same pub33 * Tx * Declare variables * Allow replacement handle * Grandfather existing handles * Test * Handleinfo * Char * * Begin * Add mutex * CCaddr * Casts for windows * +debugs * Syntax * Item * Skeet * +print * Error check things * +prints * -sleep * Brute force inventory check * Revert * num_packitems * Log file * Test * ABC * Test * Add help docs for all -ac_* params of komodod (#1313) * Remove myAddress from roc * +print * Test * Test * Leave pack all * Dont discard unless last o_count * Prevent pack corruption * -ddebugs * Merge branch 'FSM' into jl777 # Conflicts: # src/cc/rogue/main.c
This commit is contained in:
@@ -19,80 +19,38 @@
|
||||
int total = 0; /* total dynamic memory bytes */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* detach:
|
||||
* takes an item out of whatever linked list it might be in
|
||||
*/
|
||||
|
||||
void
|
||||
_detach(THING **list, THING *item)
|
||||
{
|
||||
if (*list == item)
|
||||
*list = next(item);
|
||||
if (prev(item) != NULL)
|
||||
item->l_prev->l_next = next(item);
|
||||
if (next(item) != NULL)
|
||||
item->l_next->l_prev = prev(item);
|
||||
item->l_next = NULL;
|
||||
item->l_prev = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* _attach:
|
||||
* add an item to the head of a list
|
||||
*/
|
||||
|
||||
void
|
||||
_attach(THING **list, THING *item)
|
||||
{
|
||||
if (*list != NULL)
|
||||
{
|
||||
item->l_next = *list;
|
||||
(*list)->l_prev = item;
|
||||
item->l_prev = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->l_next = NULL;
|
||||
item->l_prev = NULL;
|
||||
}
|
||||
*list = item;
|
||||
}
|
||||
|
||||
/*
|
||||
* _free_list:
|
||||
* Throw the whole blamed thing away
|
||||
*/
|
||||
|
||||
void
|
||||
_free_list(THING **ptr)
|
||||
{
|
||||
THING *item;
|
||||
|
||||
while (*ptr != NULL)
|
||||
{
|
||||
item = *ptr;
|
||||
*ptr = next(item);
|
||||
discard(item);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* discard:
|
||||
* Free up an item
|
||||
*/
|
||||
|
||||
//#define ENABLE_DEBUG
|
||||
#define MAX_DEBUGPTRS 100000
|
||||
|
||||
int32_t itemcounter;
|
||||
THING *thingptrs[100000];
|
||||
THING *thingptrs[MAX_DEBUGPTRS];
|
||||
int32_t numptrs;
|
||||
|
||||
int32_t thing_find(THING *item)
|
||||
{
|
||||
#ifdef ENABLE_DEBUG
|
||||
int32_t i;
|
||||
for (i=0; i<numptrs; i++)
|
||||
if ( item == thingptrs[i] )
|
||||
return(i);
|
||||
return(-1);
|
||||
#else
|
||||
return(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
discard(THING *item)
|
||||
{
|
||||
#ifdef MASTER
|
||||
total--;
|
||||
#endif
|
||||
if ( 0 )
|
||||
#ifdef ENABLE_DEBUG
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<numptrs; i++)
|
||||
@@ -103,6 +61,17 @@ discard(THING *item)
|
||||
break;
|
||||
}
|
||||
}
|
||||
THING *list = pack;
|
||||
for (; list != NULL; list = next(list))
|
||||
{
|
||||
if ( list == item )
|
||||
{
|
||||
fprintf(stderr,"pack item discarded? (%s)\n",inv_name(list,FALSE));
|
||||
sleep(3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
itemcounter--;
|
||||
free((char *) item);
|
||||
}
|
||||
@@ -121,6 +90,63 @@ void garbage_collect()
|
||||
numptrs = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* detach:
|
||||
* takes an item out of whatever linked list it might be in
|
||||
*/
|
||||
|
||||
void
|
||||
_detach(THING **list, THING *item)
|
||||
{
|
||||
if (*list == item)
|
||||
*list = next(item);
|
||||
if (prev(item) != NULL)
|
||||
item->l_prev->l_next = next(item);
|
||||
if (next(item) != NULL)
|
||||
item->l_next->l_prev = prev(item);
|
||||
item->l_next = NULL;
|
||||
item->l_prev = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* _attach:
|
||||
* add an item to the head of a list
|
||||
*/
|
||||
|
||||
void
|
||||
_attach(THING **list, THING *item)
|
||||
{
|
||||
if (*list != NULL)
|
||||
{
|
||||
item->l_next = *list;
|
||||
(*list)->l_prev = item;
|
||||
item->l_prev = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->l_next = NULL;
|
||||
item->l_prev = NULL;
|
||||
}
|
||||
*list = item;
|
||||
}
|
||||
|
||||
/*
|
||||
* _free_list:
|
||||
* Throw the whole blamed thing away
|
||||
*/
|
||||
|
||||
void
|
||||
_free_list(THING **ptr)
|
||||
{
|
||||
THING *item;
|
||||
while (*ptr != NULL)
|
||||
{
|
||||
item = *ptr;
|
||||
*ptr = next(item);
|
||||
discard(item);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* new_item
|
||||
* Get a new item with a specified size
|
||||
@@ -139,12 +165,14 @@ new_item(void)
|
||||
#else
|
||||
item = (THING *)calloc(1, sizeof *item);
|
||||
#endif
|
||||
if ( 0 )
|
||||
#ifdef ENABLE_DEBUG
|
||||
if ( numptrs < MAX_DEBUGPTRS )
|
||||
{
|
||||
thingptrs[numptrs++] = item;
|
||||
if ( (++itemcounter % 100) == 0 )
|
||||
fprintf(stderr,"itemcounter.%d\n",itemcounter);
|
||||
}
|
||||
#endif
|
||||
item->l_next = NULL;
|
||||
item->l_prev = NULL;
|
||||
return item;
|
||||
|
||||
Reference in New Issue
Block a user