function needsBlockFinalization()
             afterInitialization constant returns (bool) {
        
        
        
        
        uint btcTimestamp;
        int blockHash = BTCRelay(btcRelay).getBlockchainHead();
        (,btcTimestamp) = getBlockHeader(blockHash);

        uint delta = 0;
        if (btcTimestamp < block.timestamp) {
            delta = block.timestamp - btcTimestamp;
        }

        return delta < 2 * 60 * 60 &&
               lotteries[id].numTicketsSold == lotteries[id].numTickets &&
               lotteries[id].decidingBlock == -1;
    }