remove smaller bugs and unused code.

This commit is contained in:
D-Stacks 2022-06-21 23:47:07 +02:00
parent 540d77ff17
commit d9b5f0ecf1
2 changed files with 1 additions and 11 deletions

View File

@ -188,10 +188,6 @@ func (tis *txIndexStore) convertTxIDToKey(bucket *database.Bucket, txID external
return bucket.Key(txID.ByteSlice()) return bucket.Key(txID.ByteSlice())
} }
func (tis *txIndexStore) convertKeyToTxID(key *database.Key) (*externalapi.DomainTransactionID, error) {
return externalapi.NewDomainTransactionIDFromByteSlice(key.Suffix())
}
func (tis *txIndexStore) stagedData() ( func (tis *txIndexStore) stagedData() (
toAdd map[externalapi.DomainTransactionID]*externalapi.DomainHash, toAdd map[externalapi.DomainTransactionID]*externalapi.DomainHash,
virtualParents []*externalapi.DomainHash, virtualParents []*externalapi.DomainHash,

View File

@ -63,8 +63,6 @@ func (ti *TXIndex) Reset() error {
return err return err
} }
const chunkSize = 1000
//we iterate from pruningPoint up - this gurantees that newer accepting blocks overwrite older ones in the store mapping //we iterate from pruningPoint up - this gurantees that newer accepting blocks overwrite older ones in the store mapping
//we also do not collect data before pruning point, since relevent blockData is pruned (see `TO DO`` note at the top regarding archival nodes) //we also do not collect data before pruning point, since relevent blockData is pruned (see `TO DO`` note at the top regarding archival nodes)
selectedParentChainChanges, err := ti.domain.Consensus().GetVirtualSelectedParentChainFromBlock(pruningPoint) selectedParentChainChanges, err := ti.domain.Consensus().GetVirtualSelectedParentChainFromBlock(pruningPoint)
@ -153,11 +151,7 @@ func (ti *TXIndex) addTXIDs(selectedParentChainChanges *externalapi.SelectedChai
position := 0 position := 0
for position < len(selectedParentChainChanges.Added) { for position < len(selectedParentChainChanges.Added) {
var chainBlocksChunk []*externalapi.DomainHash var chainBlocksChunk []*externalapi.DomainHash
if position+chunkSize > len(selectedParentChainChanges.Added) {
chainBlocksChunk = selectedParentChainChanges.Added[position:]
} else {
chainBlocksChunk = selectedParentChainChanges.Added[position : position+chunkSize]
}
if position+chunkSize > len(selectedParentChainChanges.Added) { if position+chunkSize > len(selectedParentChainChanges.Added) {
chainBlocksChunk = selectedParentChainChanges.Added[position:] chainBlocksChunk = selectedParentChainChanges.Added[position:]