-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
. Heavily refactored code . Added some optimizations . Added a "taint" calculator callback . Output traditional bitcoin addresses for a fraction of allBalances . Added a method to convert bitcoin addresses to hash160 (not used yet)
- Loading branch information
Znort 987
committed
Jul 9, 2012
1 parent
1df1412
commit 20a0c0b
Showing
12 changed files
with
586 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,26 @@ | ||
|
||
#include <map> | ||
#include <string> | ||
#include <vector> | ||
#include <string.h> | ||
#include <callback.h> | ||
static std::vector<Callback*> *callbacks; | ||
|
||
typedef std::map<std::string, Callback*> Map; | ||
static Map *map; | ||
|
||
void Callback::add( | ||
const char *name, | ||
Callback *callback | ||
) | ||
Callback::Callback() | ||
{ | ||
if(0==map) | ||
map = new Map; | ||
|
||
(*map)[std::string(name)] = callback; | ||
if(0==callbacks) callbacks = new std::vector<Callback*>; | ||
callbacks->push_back(this); | ||
} | ||
|
||
Callback *Callback::find( | ||
const char *name | ||
) | ||
{ | ||
if(!map) | ||
return 0; | ||
|
||
auto i = map->find(std::string(name)); | ||
return (map->end()==i) ? 0 : i->second; | ||
auto e = callbacks->end(); | ||
auto i = callbacks->begin(); | ||
while(i!=e) { | ||
Callback *c = *(i++); | ||
const char *n = c->name(); | ||
if(0==strcmp(name, n)) return c; | ||
} | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.