chore: log when put/get local storage

This commit is contained in:
thinkAfCod 2024-03-06 21:18:30 +08:00
parent 2dd60032f1
commit e144a53def

View file

@ -1501,11 +1501,15 @@ func (p *PortalProtocol) InRange(contentId []byte) bool {
}
func (p *PortalProtocol) Get(contentId []byte) ([]byte, error) {
return p.storage.Get(contentId)
content, err := p.storage.Get(contentId)
p.log.Trace("get local storage", "contentId", hexutil.Encode(contentId), "content", hexutil.Encode(content), "err", err)
return content, err
}
func (p *PortalProtocol) Put(contentId []byte, content []byte) error {
return p.storage.Put(contentId, content)
err := p.storage.Put(contentId, content)
p.log.Trace("put local storage", "contentId", hexutil.Encode(contentId), "content", hexutil.Encode(content), "err", err)
return err
}
func (p *PortalProtocol) GetContent() <-chan *ContentElement {