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

    return transactionResponse
  }

  func fetchBlockWithHash(hash: NSData) -> Block? {
    let inventoryVector = InventoryVector(type: .Block, hash: hash)
    getDataMessage = GetDataMessage(inventoryVectors: [inventoryVector])
    let connection = connect()
    waitWithTimeout(30)
    connection.disconnect()

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

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