Implement NSPV_getnotarization_txid
This commit is contained in:
@@ -135,3 +135,30 @@ int ScanNotarisationsDB(int height, std::string symbol, int scanLimitBlocks, Not
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ScanNotarisationsDB2(int height, std::string symbol, int scanLimitBlocks, Notarisation& out)
|
||||
{
|
||||
int32_t i,maxheight,ht;
|
||||
maxheight = chainActive.Height();
|
||||
if ( height < 0 || height > maxheight )
|
||||
return false;
|
||||
for (i=0; i<scanLimitBlocks; i++)
|
||||
{
|
||||
ht = height+i;
|
||||
if ( ht > maxheight )
|
||||
break;
|
||||
NotarisationsInBlock notarisations;
|
||||
uint256 blockHash = *chainActive[ht]->phashBlock;
|
||||
if ( !GetBlockNotarisations(blockHash,notarisations) )
|
||||
continue;
|
||||
BOOST_FOREACH(Notarisation& nota,notarisations)
|
||||
{
|
||||
if ( strcmp(nota.second.symbol,symbol.data()) == 0 )
|
||||
{
|
||||
out = nota;
|
||||
return(ht);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user