more wip, squashme
This commit is contained in:
parent
9e4b3ae88a
commit
4bc523e6b4
@ -77,6 +77,14 @@ func (bs *BlockSync) GetBlocks(ctx context.Context, tipset []cid.Cid, count int)
|
||||
|
||||
var oerr error
|
||||
for _, p := range peers {
|
||||
// TODO: doing this synchronously isnt great, but fetching in parallel
|
||||
// may not be a good idea either. think about this more
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil, xerrors.Errorf("blocksync getblocks failed: %w", ctx.Err())
|
||||
default:
|
||||
}
|
||||
|
||||
res, err := bs.sendRequestToPeer(ctx, p, req)
|
||||
if err != nil {
|
||||
oerr = err
|
||||
|
@ -54,6 +54,10 @@ func (sm *SyncManager) SetPeerHead(p peer.ID, ts *types.TipSet) {
|
||||
|
||||
}
|
||||
|
||||
func (sm *SyncManager) selectSyncTarget() (*types.TipSet, error) {
|
||||
panic("NYI")
|
||||
}
|
||||
|
||||
func (sm *SyncManager) syncWorker(id int) {
|
||||
for {
|
||||
select {
|
||||
|
Loading…
Reference in New Issue
Block a user