mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
Remove unnecessary wg from Chunk
This commit is contained in:
parent
4e0303f782
commit
772153a4b4
2 changed files with 7 additions and 15 deletions
|
|
@ -43,14 +43,8 @@ func NewLocalStore(hash SwarmHasher, params *StoreParams, basekey []byte) (*Loca
|
||||||
// unsafe, in that the data is not integrity checked
|
// unsafe, in that the data is not integrity checked
|
||||||
func (self *LocalStore) Put(chunk *Chunk) {
|
func (self *LocalStore) Put(chunk *Chunk) {
|
||||||
self.memStore.Put(chunk)
|
self.memStore.Put(chunk)
|
||||||
if chunk.wg != nil {
|
|
||||||
chunk.wg.Add(1)
|
|
||||||
}
|
|
||||||
go func() {
|
go func() {
|
||||||
self.DbStore.Put(chunk)
|
self.DbStore.Put(chunk)
|
||||||
if chunk.wg != nil {
|
|
||||||
chunk.wg.Done()
|
|
||||||
}
|
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"hash"
|
"hash"
|
||||||
"io"
|
"io"
|
||||||
"sync"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/bmt"
|
"github.com/ethereum/go-ethereum/bmt"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
|
@ -200,7 +199,6 @@ type Chunk struct {
|
||||||
Source Peer // peer
|
Source Peer // peer
|
||||||
C chan bool // to signal data delivery by the dpa
|
C chan bool // to signal data delivery by the dpa
|
||||||
Req *RequestStatus // request Status needed by netStore
|
Req *RequestStatus // request Status needed by netStore
|
||||||
wg *sync.WaitGroup // wg to synchronize
|
|
||||||
dbStored chan bool // never remove a chunk from memStore before it is written to dbStore
|
dbStored chan bool // never remove a chunk from memStore before it is written to dbStore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue