more wip, squashme

This commit is contained in:
whyrusleeping 2019-11-13 09:03:56 -08:00
parent 9e4b3ae88a
commit 4bc523e6b4
2 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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 {