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:
2026-11-19 08:03:10 +01:00
co-authored by Claude Sonnet 5.5
parent 2f89a599e3
commit 1f1f649800
7 changed files with 204 additions and 4 deletions
+3
View File
@@ -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