diff --git a/domain/txindex.go/store.go b/domain/txindex.go/store.go index 8101dfca1..927508faf 100644 --- a/domain/txindex.go/store.go +++ b/domain/txindex.go/store.go @@ -188,10 +188,6 @@ func (tis *txIndexStore) convertTxIDToKey(bucket *database.Bucket, txID external return bucket.Key(txID.ByteSlice()) } -func (tis *txIndexStore) convertKeyToTxID(key *database.Key) (*externalapi.DomainTransactionID, error) { - return externalapi.NewDomainTransactionIDFromByteSlice(key.Suffix()) -} - func (tis *txIndexStore) stagedData() ( toAdd map[externalapi.DomainTransactionID]*externalapi.DomainHash, virtualParents []*externalapi.DomainHash, diff --git a/domain/txindex.go/txindex.go b/domain/txindex.go/txindex.go index 1e94fe817..83d93d4ee 100644 --- a/domain/txindex.go/txindex.go +++ b/domain/txindex.go/txindex.go @@ -63,8 +63,6 @@ func (ti *TXIndex) Reset() error { return err } - const chunkSize = 1000 - //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) selectedParentChainChanges, err := ti.domain.Consensus().GetVirtualSelectedParentChainFromBlock(pruningPoint) @@ -153,11 +151,7 @@ func (ti *TXIndex) addTXIDs(selectedParentChainChanges *externalapi.SelectedChai position := 0 for position < len(selectedParentChainChanges.Added) { 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) { chainBlocksChunk = selectedParentChainChanges.Added[position:]