Skip to content

Commit

Permalink
Merge pull request #125 from gfanton/feat/remoteheads
Browse files Browse the repository at this point in the history
  • Loading branch information
gfanton authored Mar 28, 2023
2 parents 326aee1 + 3bfc8df commit abc7b33
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions stores/basestore/base_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1184,16 +1184,15 @@ func (b *BaseStore) exchangeHeads(p peer.ID) error {
return fmt.Errorf("unable to get local heads from cache: %w", err)
}

// @FIXME(gfanton): looks like activate this break the exchange
// rawRemoteHeads, err := store.Cache().Get(b.ctx, datastore.NewKey("_remoteHeads"))
// if err != nil && err != datastore.ErrNotFound {
// return fmt.Errorf("unable to get data from cache: %w", err)
// }
rawRemoteHeads, err := b.Cache().Get(b.ctx, datastore.NewKey("_remoteHeads"))
if err != nil && err != datastore.ErrNotFound {
return fmt.Errorf("unable to get data from cache: %w", err)
}

heads := []*entry.Entry{}

for _, rawHeads := range [][]byte{rawLocalHeads} {
if len(rawLocalHeads) > 0 {
for _, rawHeads := range [][]byte{rawLocalHeads, rawRemoteHeads} {
if len(rawHeads) > 0 {
var dHeads []*entry.Entry
err = json.Unmarshal(rawHeads, &dHeads)
if err != nil {
Expand Down

0 comments on commit abc7b33

Please sign in to comment.