mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-24 06:25:55 +00:00
remove smaller bugs and unused code.
This commit is contained in:
parent
540d77ff17
commit
d9b5f0ecf1
@ -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,
|
||||
|
||||
@ -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:]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user