fix for TXSCL data leak
This commit is contained in:
@@ -50,6 +50,8 @@ uint256 CalculateProofRoot(const char* symbol, uint32_t targetCCid, int kmdHeigh
|
|||||||
|
|
||||||
int seenOwnNotarisations = 0;
|
int seenOwnNotarisations = 0;
|
||||||
|
|
||||||
|
bool txscl = IsTXSCL(symbol);
|
||||||
|
|
||||||
for (int i=0; i<NOTARISATION_SCAN_LIMIT_BLOCKS; i++) {
|
for (int i=0; i<NOTARISATION_SCAN_LIMIT_BLOCKS; i++) {
|
||||||
if (i > kmdHeight) break;
|
if (i > kmdHeight) break;
|
||||||
NotarisationsInBlock notarisations;
|
NotarisationsInBlock notarisations;
|
||||||
@@ -72,8 +74,9 @@ uint256 CalculateProofRoot(const char* symbol, uint32_t targetCCid, int kmdHeigh
|
|||||||
|
|
||||||
if (seenOwnNotarisations == 1) {
|
if (seenOwnNotarisations == 1) {
|
||||||
BOOST_FOREACH(Notarisation& nota, notarisations) {
|
BOOST_FOREACH(Notarisation& nota, notarisations) {
|
||||||
if (nota.second.ccId == targetCCid)
|
if (IsTXSCL(nota.second.symbol) == txscl)
|
||||||
moms.push_back(nota.second.MoM);
|
if (nota.second.ccId == targetCCid)
|
||||||
|
moms.push_back(nota.second.MoM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ NotarisationsInBlock ScanBlockNotarisations(const CBlock &block, int nHeight)
|
|||||||
{
|
{
|
||||||
NotarisationData data;
|
NotarisationData data;
|
||||||
if (ParseNotarisationOpReturn(tx, data))
|
if (ParseNotarisationOpReturn(tx, data))
|
||||||
if (strlen(data.symbol) >= 5 && strncmp(data.symbol, "TXSCL", 5) == 0)
|
if (IsTXSCL(data.symbol))
|
||||||
isTxscl = 1;
|
isTxscl = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,6 +46,11 @@ NotarisationsInBlock ScanBlockNotarisations(const CBlock &block, int nHeight)
|
|||||||
return vNotarisations;
|
return vNotarisations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsTXSCL(const char* symbol)
|
||||||
|
{
|
||||||
|
return strlen(symbol) >= 5 && strncmp(symbol, "TXSCL", 5) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GetBlockNotarisations(uint256 blockHash, NotarisationsInBlock &nibs)
|
bool GetBlockNotarisations(uint256 blockHash, NotarisationsInBlock &nibs)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,5 +24,6 @@ bool GetBackNotarisation(uint256 notarisationHash, Notarisation &n);
|
|||||||
void WriteBackNotarisations(const NotarisationsInBlock notarisations, CLevelDBBatch &batch);
|
void WriteBackNotarisations(const NotarisationsInBlock notarisations, CLevelDBBatch &batch);
|
||||||
void EraseBackNotarisations(const NotarisationsInBlock notarisations, CLevelDBBatch &batch);
|
void EraseBackNotarisations(const NotarisationsInBlock notarisations, CLevelDBBatch &batch);
|
||||||
int ScanNotarisationsDB(int height, std::string symbol, int scanLimitBlocks, Notarisation& out);
|
int ScanNotarisationsDB(int height, std::string symbol, int scanLimitBlocks, Notarisation& out);
|
||||||
|
bool IsTXSCL(const char* symbol);
|
||||||
|
|
||||||
#endif /* NOTARISATIONDB_H */
|
#endif /* NOTARISATIONDB_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user