This commit is contained in:
jed
2011-10-27 16:59:42 -07:00
parent 7eae6e5886
commit e68b0fb8d1
23 changed files with 165 additions and 65 deletions

View File

@@ -1,5 +1,7 @@
#include "UniqueNodeList.h"
#include "Application.h"
#include "Convertion.h"
using namespace std;
void UniqueNodeList::addNode(uint160& hanko, vector<unsigned char>& publicKey)
@@ -54,3 +56,25 @@ int UniqueNodeList::checkValid(newcoin::Validation& valid)
return(0); // not on our list
}
void UniqueNodeList::dumpUNL(std::string& retStr)
{
Database* db=theApp->getDB();
string sql="SELECT * FROM UNL";
if( db->executeSQL(sql.c_str()) )
{
db->startIterRows();
while(db->getNextRow())
{
uint160 hanko;
int size=db->getBinary("Hanko",hanko.begin(),hanko.GetSerializeSize());
string tstr;
u160ToHuman(hanko,tstr);
retStr.append(tstr);
retStr.append("\n");
}
db->endIterRows();
}
}