This commit is contained in:
blackjok3r
2019-02-06 21:09:43 +08:00
parent cedc9465e6
commit e2e7614dff

View File

@@ -371,21 +371,22 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
{ {
// check a notary didnt sign twice (this would be an invalid notarisation later on and cause problems) // check a notary didnt sign twice (this would be an invalid notarisation later on and cause problems)
std::set<int> checkdupes( NotarisationNotaries.begin(), NotarisationNotaries.end() ); std::set<int> checkdupes( NotarisationNotaries.begin(), NotarisationNotaries.end() );
if ( tx.GetHash().ToString() == invalidnotarisation ) if ( checkdupes.size() != NotarisationNotaries.size() )
{
NotarisationNotaries.clear();
fprintf(stderr, "notarisation %s is invalid leave it as a normal tx.\n", invalidnotarisation.c_str());
}
else if ( checkdupes.size() != NotarisationNotaries.size() )
{ {
NotarisationNotaries.clear(); NotarisationNotaries.clear();
fprintf(stderr, "possible notarisation is signed multiple times by same notary, passed as normal transaction.\n"); fprintf(stderr, "possible notarisation is signed multiple times by same notary, passed as normal transaction.\n");
} }
else if ( tx.GetHash().ToString() == invalidnotarisation )
{
// check if the last notarisation we tried was flagged as invalid.
// then clear it, in case next time it is seen as valid.
NotarisationNotaries.clear();
invalidnotarisation = "";
fprintf(stderr, "notarisation %s is invalid leave it as a normal tx.\n", invalidnotarisation.c_str());
}
else else
fNotarisation = true; fNotarisation = true;
} } else NotarisationNotaries.clear();
else
NotarisationNotaries.clear();
nTotalIn += tx.GetShieldedValueIn(); nTotalIn += tx.GetShieldedValueIn();
} }