mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 22:56:43 +00:00
Remove HasBlobs and use GetBlobCounts
This commit is contained in:
parent
81daff43ac
commit
7ad169f672
4 changed files with 0 additions and 37 deletions
|
|
@ -1325,19 +1325,6 @@ func (p *BlobPool) GetBlobs(vhashes []common.Hash) []*types.BlobTxSidecar {
|
|||
return sidecars
|
||||
}
|
||||
|
||||
func (p *BlobPool) HasBlobs(vhashes []common.Hash) bool {
|
||||
for _, vhash := range vhashes {
|
||||
// Retrieve the datastore item (in a short lock)
|
||||
p.lock.RLock()
|
||||
_, exists := p.lookup.storeidOfBlob(vhash)
|
||||
p.lock.RUnlock()
|
||||
if !exists {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *BlobPool) GetBlobCounts(vhashes []common.Hash) int {
|
||||
count := 0
|
||||
for _, vhash := range vhashes {
|
||||
|
|
|
|||
|
|
@ -1068,12 +1068,6 @@ func (pool *LegacyPool) GetBlobs(vhashes []common.Hash) []*types.BlobTxSidecar {
|
|||
return nil
|
||||
}
|
||||
|
||||
// HasBlobs is not supported by the legacy transaction pool, it is just here to
|
||||
// implement the txpool.SubPool interface.
|
||||
func (pool *LegacyPool) HasBlobs(vhashes []common.Hash) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// GetBlobCounts returns number of blobs in the subpool that matches the given
|
||||
// versioned hashes, without performing db read.
|
||||
func (pool *LegacyPool) GetBlobCounts(vhashes []common.Hash) int {
|
||||
|
|
|
|||
|
|
@ -137,10 +137,6 @@ type SubPool interface {
|
|||
// retrieve blobs from the pools directly instead of the network.
|
||||
GetBlobs(vhashes []common.Hash) []*types.BlobTxSidecar
|
||||
|
||||
// HasBlobs returns true if all blobs corresponding to the versioned hashes
|
||||
// are in the sub pool.
|
||||
HasBlobs(vhashes []common.Hash) bool
|
||||
|
||||
// GetBlobCounts returns number of blobs in the subpool that matches the given
|
||||
// versioned hashes, without performing db read.
|
||||
GetBlobCounts(vhashes []common.Hash) int
|
||||
|
|
|
|||
|
|
@ -334,20 +334,6 @@ func (p *TxPool) GetBlobCounts(vhashes []common.Hash) int {
|
|||
return 0
|
||||
}
|
||||
|
||||
// HasBlobs will return true if all the vhashes are available in the same subpool.
|
||||
func (p *TxPool) HasBlobs(vhashes []common.Hash) bool {
|
||||
for _, subpool := range p.subpools {
|
||||
// It's an ugly to assume that only one pool will be capable of returning
|
||||
// anything meaningful for this call, but anything else requires merging
|
||||
// partial responses and that's too annoying to do until we get a second
|
||||
// blobpool (probably never).
|
||||
if subpool.HasBlobs(vhashes) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// ValidateTxBasics checks whether a transaction is valid according to the consensus
|
||||
// rules, but does not check state-dependent validation such as sufficient balance.
|
||||
func (p *TxPool) ValidateTxBasics(tx *types.Transaction) error {
|
||||
|
|
|
|||
Loading…
Reference in a new issue