(blkNum uint32, block *Block)
| 497 | } |
| 498 | |
| 499 | func (self *PeerSyncer) fetchedBlock(blkNum uint32, block *Block) error { |
| 500 | self.lock.Lock() |
| 501 | defer self.lock.Unlock() |
| 502 | |
| 503 | if blkNum == self.nextReqBlkNum { |
| 504 | self.server.syncer.blockFromPeerC <- &BlockMsgFromPeer{ |
| 505 | fromPeer: self.peerIdx, |
| 506 | block: block, |
| 507 | } |
| 508 | self.nextReqBlkNum++ |
| 509 | } |
| 510 | |
| 511 | return nil |
| 512 | } |