 
   func peerConnection(peerConnection: PeerConnection,
                       didConnectWithPeerVersion peerVersion: VersionMessage) {
-    if let message = getDataMessage {
+    if let message = getHeadersMessage {
+      peerConnection.sendMessageWithPayload(message)
+    } else if let message = getDataMessage {
       peerConnection.sendMessageWithPayload(message)
     }
   }

  let queue = NSOperationQueue()
  let semaphore = dispatch_semaphore_create(0)
  var getDataMessage: GetDataMessage?
  var transactionResponse: Transaction?
  var blockResponse: Block?

  func fetchTransactionWithHash(hash: NSData) -> Transaction? {
    let inventoryVector = InventoryVector(type: .Transaction, hash: hash)

      case .Transaction(let transaction):
        transactionResponse = transaction
        dispatch_semaphore_signal(semaphore)
      case .HeadersMessage(let headersMessage):
        blockResponse = headersMessage.headers[0]
        dispatch_semaphore_signal(semaphore)
      case .NotFoundMessage(let notFoundMessage):
        println("Not Found")
