p2p: a node asks its peers for its own listings after losing its database
Sync kind 'author': everything a peer holds from one author key, any region. A node asks the first 3 peers it syncs with per run. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"math/rand/v2"
|
||||
"slices"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/libp2p/go-libp2p"
|
||||
@@ -139,6 +140,8 @@ type Node struct {
|
||||
guard *peerGuard
|
||||
// gossipIn counts listings that arrived by gossip since the last summary.
|
||||
gossipIn tally
|
||||
// recoverAsked counts the peers asked for our own listings (see recoverOwn).
|
||||
recoverAsked atomic.Int32
|
||||
|
||||
ctx context.Context
|
||||
cancel context.CancelFunc
|
||||
|
||||
Reference in New Issue
Block a user