[bitcoin/bitcoin] Utxoscriptindex (#14035)

mgrychow commented on this pull request.

> + {
+ for(unsigned int j = 0; j < (block.vtx[i])->vin.size(); ++j)
+ {
+ removeUtxo(blockundo.vtxundo[i-1].vprevout[j].out,
+ block.vtx[i]->vin[j].prevout);
+ }
+ }
+}
+
+void UtxoScriptIndex::removeUtxosOnTipDisconnected(const CBlock& block)
+{
+ if(block.vtx.size() == 0)
+ return;
+
+ unsigned int i = block.vtx.size() — 1;
+ while(true)

Loop needs to execute for `i==0` too (that is block’s tx with index 0); `i` is unsigned so after decrementation it overflows and such loop would be indefinite