(peerList)
| 519 | |
| 520 | @staticmethod |
| 521 | def assembleAddr(peerList): |
| 522 | if isinstance(peerList, state.Peer): |
| 523 | peerList = (peerList) |
| 524 | if not peerList: |
| 525 | return b'' |
| 526 | retval = b'' |
| 527 | for i in range(0, len(peerList), BMProto.maxAddrCount): |
| 528 | payload = addresses.encodeVarint(len(peerList[i:i + BMProto.maxAddrCount])) |
| 529 | for address in peerList[i:i + BMProto.maxAddrCount]: |
| 530 | stream, peer, timestamp = address |
| 531 | payload += struct.pack( |
| 532 | '>Q', timestamp) # 64-bit time |
| 533 | payload += struct.pack('>I', stream) |
| 534 | payload += struct.pack( |
| 535 | '>q', 1) # service bit flags offered by this node |
| 536 | payload += protocol.encodeHost(peer.host) |
| 537 | payload += struct.pack('>H', peer.port) # remote port |
| 538 | retval += protocol.CreatePacket('addr', payload) |
| 539 | return retval |
| 540 | |
| 541 | @staticmethod |
| 542 | def stopDownloadingObject(hashId, forwardAnyway=False): |
no outgoing calls
no test coverage detected