m3 test proven

This commit is contained in:
Scott Sadler
2018-05-15 22:27:10 -03:00
parent 20c3ac51c2
commit 06c960d2b7
12 changed files with 249 additions and 231 deletions

View File

@@ -9,19 +9,18 @@
NotarisationDB *pnotarisations;
NotarisationDB::NotarisationDB(size_t nCacheSize, bool fMemory, bool fWipe) : CLevelDBWrapper(GetDataDir() / "notarisations", nCacheSize, fMemory, fWipe, false, 64) {
}
NotarisationDB::NotarisationDB(size_t nCacheSize, bool fMemory, bool fWipe) : CLevelDBWrapper(GetDataDir() / "notarisations", nCacheSize, fMemory, fWipe, false, 64) { }
NotarisationsInBlock GetNotarisationsInBlock(const CBlock &block, int nHeight)
{
EvalRef eval;
NotarisationsInBlock vNotarisations;
bool IsBackNotarisation = ASSETCHAINS_SYMBOL[0] != 0;
for (unsigned int i = 0; i < block.vtx.size(); i++) {
CTransaction tx = block.vtx[i];
if (eval->CheckNotaryInputs(tx, nHeight, block.nTime)) {
NotarisationData data(IsBackNotarisation);
NotarisationData data;
if (ParseNotarisationOpReturn(tx, data))
vNotarisations.push_back(std::make_pair(tx.GetHash(), data));
else
@@ -40,7 +39,9 @@ void WriteBackNotarisations(NotarisationsInBlock notarisations)
{
BOOST_FOREACH(Notarisation &n, notarisations)
{
if (n.second.IsBackNotarisation)
if (n.second.IsBackNotarisation) {
pnotarisations->Write(n.second.txHash, n);
printf("WriteBackNotarisations {\n m3:%s\n}\n", n.second.MoMoM.GetHex().data());
}
}
}